2026-03-27 05:35:18 +01:00
|
|
|
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
import AdminShell from '~/components/AdminShell';
|
|
|
|
|
|
2026-04-02 13:09:42 +02:00
|
|
|
type AdminContact = {
|
|
|
|
|
name: string;
|
|
|
|
|
email: string;
|
|
|
|
|
phone: string;
|
2026-03-27 05:35:18 +01:00
|
|
|
};
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
2026-04-02 13:09:42 +02:00
|
|
|
type CompanyRecord = {
|
|
|
|
|
id: string;
|
|
|
|
|
companyCode: string;
|
|
|
|
|
name: string;
|
|
|
|
|
registrationNumber: string;
|
|
|
|
|
industry: string;
|
|
|
|
|
location: string;
|
|
|
|
|
joinedOn: string;
|
|
|
|
|
adminContact: AdminContact;
|
|
|
|
|
accountStatus: string;
|
|
|
|
|
verificationStatus: string;
|
|
|
|
|
subscriptionType: string;
|
|
|
|
|
jobPostingsCount: number;
|
|
|
|
|
totalHires: number;
|
|
|
|
|
updatedAt: string;
|
|
|
|
|
};
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
2026-03-27 05:35:18 +01:00
|
|
|
export default function CompanyManagementPage() {
|
2026-04-02 13:09:42 +02:00
|
|
|
const [rows, setRows] = createSignal<CompanyRecord[]>([]);
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
const [search, setSearch] = createSignal('');
|
2026-03-27 05:35:18 +01:00
|
|
|
const [statusFilter, setStatusFilter] = createSignal('all');
|
2026-04-02 13:09:42 +02:00
|
|
|
const [sortBy, setSortBy] = createSignal('name_asc');
|
2026-03-27 05:35:18 +01:00
|
|
|
|
|
|
|
|
const load = async () => {
|
|
|
|
|
try {
|
2026-04-02 13:09:42 +02:00
|
|
|
const r = await fetch('/api/admin/companies');
|
|
|
|
|
if (!r.ok) throw new Error('Failed to fetch companies');
|
|
|
|
|
const data = await r.json();
|
|
|
|
|
const mapped: CompanyRecord[] = data.map((c: any) => ({
|
2026-03-27 05:35:18 +01:00
|
|
|
id: c.id,
|
2026-04-02 13:09:42 +02:00
|
|
|
companyCode: c.id.slice(0, 8).toUpperCase(),
|
|
|
|
|
name: c.company_name,
|
|
|
|
|
registrationNumber: c.registration_number || 'Pending Registration',
|
|
|
|
|
industry: c.industry || 'Not Specified',
|
|
|
|
|
location: 'Not Specified',
|
|
|
|
|
joinedOn: new Date(c.created_at).toLocaleDateString(),
|
|
|
|
|
adminContact: { name: 'Company Admin', email: '...', phone: '...' },
|
|
|
|
|
accountStatus: c.status.toUpperCase(),
|
|
|
|
|
verificationStatus: c.status === 'APPROVED' ? 'VERIFIED' : 'PENDING',
|
|
|
|
|
subscriptionType: 'STANDARD',
|
|
|
|
|
jobPostingsCount: 0,
|
|
|
|
|
totalHires: 0,
|
|
|
|
|
updatedAt: c.updated_at,
|
|
|
|
|
}));
|
|
|
|
|
setRows(mapped);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error(e);
|
|
|
|
|
setRows([]);
|
2026-03-27 05:35:18 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMount(() => void load());
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
2026-03-27 05:35:18 +01:00
|
|
|
const filteredRows = createMemo(() => {
|
|
|
|
|
let r = rows();
|
2026-04-02 13:09:42 +02:00
|
|
|
if (statusFilter() !== 'all') r = r.filter((d) => d.accountStatus === statusFilter().toUpperCase());
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
const q = search().toLowerCase();
|
2026-03-27 05:35:18 +01:00
|
|
|
if (q) {
|
2026-04-02 13:09:42 +02:00
|
|
|
r = r.filter(it => it.name.toLowerCase().includes(q) || it.companyCode.toLowerCase().includes(q));
|
2026-03-27 05:35:18 +01:00
|
|
|
}
|
|
|
|
|
const sorted = [...r];
|
|
|
|
|
sorted.sort((a, b) => {
|
2026-04-02 13:09:42 +02:00
|
|
|
if (sortBy() === 'name_desc') return b.name.localeCompare(a.name);
|
2026-03-27 05:35:18 +01:00
|
|
|
return a.name.localeCompare(b.name);
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
});
|
2026-03-27 05:35:18 +01:00
|
|
|
return sorted;
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<AdminShell>
|
2026-03-27 05:35:18 +01:00
|
|
|
<div class="w-full space-y-6 pb-8">
|
2026-04-02 13:09:42 +02:00
|
|
|
<div class="flex items-center justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<h1 class="text-2xl font-bold text-[#111827]">Companies Management</h1>
|
|
|
|
|
<p class="text-sm text-[#6B7280]">Manage all registered companies and their verification status.</p>
|
ui(step-2): apply reference layout to 8 management pages
- customer, candidate, photographer, makeup-artist, users, company,
developers, tutors: all get white sticky header, -mx-6/-mt-6 layout,
data-table/table-card CSS classes, navy primary buttons, orange tab
underlines, Tailwind classes replacing inline styles on all table cells
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:51:40 +01:00
|
|
|
</div>
|
2026-04-02 13:09:42 +02:00
|
|
|
</div>
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
2026-04-02 13:09:42 +02:00
|
|
|
<div class="flex items-center gap-4 bg-white p-4 rounded-xl border border-[#E5E7EB]">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder="Search company..."
|
|
|
|
|
class="flex-1 h-10 px-4 rounded-lg border border-[#E5E7EB] outline-none focus:border-[#FF5E13]"
|
|
|
|
|
value={search()}
|
|
|
|
|
onInput={(e) => setSearch(e.currentTarget.value)}
|
|
|
|
|
/>
|
|
|
|
|
<select
|
|
|
|
|
class="h-10 px-4 rounded-lg border border-[#E5E7EB] outline-none"
|
|
|
|
|
value={statusFilter()}
|
|
|
|
|
onChange={(e) => setStatusFilter(e.currentTarget.value)}
|
|
|
|
|
>
|
|
|
|
|
<option value="all">All Status</option>
|
|
|
|
|
<option value="pending">Pending</option>
|
|
|
|
|
<option value="active">Active</option>
|
|
|
|
|
<option value="suspended">Suspended</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2026-03-27 05:35:18 +01:00
|
|
|
|
2026-04-02 13:09:42 +02:00
|
|
|
<div class="bg-white rounded-xl border border-[#E5E7EB] overflow-hidden">
|
|
|
|
|
<table class="min-w-full divide-y divide-[#E5E7EB]">
|
|
|
|
|
<thead class="bg-[#F9FAFB]">
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="px-6 py-3 text-left text-xs font-semibold text-[#4B5563] uppercase tracking-wider">Company</th>
|
|
|
|
|
<th class="px-6 py-3 text-left text-xs font-semibold text-[#4B5563] uppercase tracking-wider">Industry</th>
|
|
|
|
|
<th class="px-6 py-3 text-left text-xs font-semibold text-[#4B5563] uppercase tracking-wider">Status</th>
|
|
|
|
|
<th class="px-6 py-3 text-left text-xs font-semibold text-[#4B5563] uppercase tracking-wider">Joined</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody class="divide-y divide-[#E5E7EB]">
|
|
|
|
|
<For each={filteredRows()}>{(c) => (
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="px-6 py-4">
|
|
|
|
|
<div class="font-semibold text-[#111827]">{c.name}</div>
|
|
|
|
|
<div class="text-xs text-[#6B7280]">{c.companyCode}</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-6 py-4 text-sm text-[#4B5563]">{c.industry}</td>
|
|
|
|
|
<td class="px-6 py-4">
|
|
|
|
|
<span class={`px-2 py-1 text-xs font-bold rounded-full ${c.accountStatus === 'ACTIVE' ? 'bg-green-100 text-green-700' : 'bg-yellow-100 text-yellow-700'}`}>
|
|
|
|
|
{c.accountStatus}
|
|
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-6 py-4 text-sm text-[#4B5563]">{c.joinedOn}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
)}</For>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
</div>
|
ui(step-2): apply reference layout to 8 management pages
- customer, candidate, photographer, makeup-artist, users, company,
developers, tutors: all get white sticky header, -mx-6/-mt-6 layout,
data-table/table-card CSS classes, navy primary buttons, orange tab
underlines, Tailwind classes replacing inline styles on all table cells
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:51:40 +01:00
|
|
|
</div>
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
</AdminShell>
|
|
|
|
|
);
|
|
|
|
|
}
|