2026-03-19 15:05:13 +01:00
|
|
|
import { A, useParams } from '@solidjs/router';
|
2026-03-19 15:14:15 +01:00
|
|
|
import { For, createMemo, createResource, Show } from 'solid-js';
|
2026-03-19 15:05:13 +01:00
|
|
|
import AdminShell from '~/components/AdminShell';
|
|
|
|
|
|
|
|
|
|
const API = '/api/gateway';
|
|
|
|
|
|
|
|
|
|
type Photographer = {
|
|
|
|
|
id: string;
|
|
|
|
|
name?: string;
|
|
|
|
|
full_name?: string;
|
|
|
|
|
email?: string;
|
|
|
|
|
phone?: string;
|
|
|
|
|
status?: string;
|
|
|
|
|
created_at?: string;
|
|
|
|
|
createdAt?: string;
|
|
|
|
|
city?: string;
|
|
|
|
|
state?: string;
|
|
|
|
|
experience?: string;
|
|
|
|
|
portfolio_url?: string;
|
2026-03-19 15:14:15 +01:00
|
|
|
phoneNumber?: string;
|
|
|
|
|
location?: string;
|
|
|
|
|
gender?: string;
|
|
|
|
|
availability?: string;
|
|
|
|
|
permanentAddress?: string;
|
|
|
|
|
hometown?: string;
|
|
|
|
|
pincode?: string;
|
|
|
|
|
languages?: Array<{ language?: string; proficiency?: string }>;
|
2026-03-19 15:05:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
async function fetchPhotographer(id: string): Promise<Photographer | null> {
|
|
|
|
|
try {
|
|
|
|
|
const res = await fetch(`${API}/api/admin/users/${id}`);
|
|
|
|
|
if (res.ok) return res.json();
|
|
|
|
|
const fallback = await fetch(`${API}/api/users/${id}`);
|
2026-03-19 15:14:15 +01:00
|
|
|
if (fallback.ok) return fallback.json();
|
|
|
|
|
const photographerRes = await fetch(`${API}/api/photographers/${id}`);
|
|
|
|
|
if (!photographerRes.ok) return null;
|
|
|
|
|
return photographerRes.json();
|
2026-03-19 15:05:13 +01:00
|
|
|
} catch {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function PhotographerDetailPage() {
|
|
|
|
|
const params = useParams();
|
|
|
|
|
const [profile] = createResource(() => params.id, fetchPhotographer);
|
|
|
|
|
|
|
|
|
|
const name = createMemo(() => profile()?.name || profile()?.full_name || 'Photographer');
|
|
|
|
|
const created = createMemo(() => profile()?.createdAt || profile()?.created_at || '');
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<AdminShell>
|
style: apply consistent page header pattern across all admin routes
- Replace text-2xl font-bold with text-xl font-semibold in all page headers
- Replace bg-[#fd6216] orange buttons with bg-[#0a1d37] navy buttons
- Wrap all pages in -mx-6 -mt-6 flex flex-col layout for edge-to-edge headers
- Replace .field/.actions CSS classes with explicit Tailwind utility classes
- Apply data-table/table-card shared CSS classes to remaining list pages
- Remove duplicate tab bar from roles/index.tsx (AdminShell TAB_SETS handles it)
- Move Create Internal Role button to page header in roles/index.tsx
Pages updated: applications, modules, responses, verification-status,
company/create, company/[id], employees/[id]/edit, users/[id]/edit,
users/details/[id], roles/index, roles/[id]/index, roles/[id]/edit,
role-ui-configs, runtime-roles/[roleKey], onboarding-schemas/*,
external/internal-dashboard-management, approval/[id], approval,
jobs/[id], leads/[id], photographer/[id], requirements/[id],
kb/articles/[id], kb/articles/[id]/edit, verification/[id],
verification-status/[id], help/[id], help/support-bridge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 07:37:02 +01:00
|
|
|
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
|
|
|
|
|
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
|
2026-03-19 15:05:13 +01:00
|
|
|
<div>
|
style: apply consistent page header pattern across all admin routes
- Replace text-2xl font-bold with text-xl font-semibold in all page headers
- Replace bg-[#fd6216] orange buttons with bg-[#0a1d37] navy buttons
- Wrap all pages in -mx-6 -mt-6 flex flex-col layout for edge-to-edge headers
- Replace .field/.actions CSS classes with explicit Tailwind utility classes
- Apply data-table/table-card shared CSS classes to remaining list pages
- Remove duplicate tab bar from roles/index.tsx (AdminShell TAB_SETS handles it)
- Move Create Internal Role button to page header in roles/index.tsx
Pages updated: applications, modules, responses, verification-status,
company/create, company/[id], employees/[id]/edit, users/[id]/edit,
users/details/[id], roles/index, roles/[id]/index, roles/[id]/edit,
role-ui-configs, runtime-roles/[roleKey], onboarding-schemas/*,
external/internal-dashboard-management, approval/[id], approval,
jobs/[id], leads/[id], photographer/[id], requirements/[id],
kb/articles/[id], kb/articles/[id]/edit, verification/[id],
verification-status/[id], help/[id], help/support-bridge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 07:37:02 +01:00
|
|
|
<h1 class="text-xl font-semibold text-gray-900">Photographer Detail</h1>
|
|
|
|
|
<p class="text-sm text-gray-500 mt-0.5">View profile snapshot and account metadata for one photographer.</p>
|
2026-03-19 15:05:13 +01:00
|
|
|
</div>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
<div class="flex items-center gap-2">
|
style: apply consistent page header pattern across all admin routes
- Replace text-2xl font-bold with text-xl font-semibold in all page headers
- Replace bg-[#fd6216] orange buttons with bg-[#0a1d37] navy buttons
- Wrap all pages in -mx-6 -mt-6 flex flex-col layout for edge-to-edge headers
- Replace .field/.actions CSS classes with explicit Tailwind utility classes
- Apply data-table/table-card shared CSS classes to remaining list pages
- Remove duplicate tab bar from roles/index.tsx (AdminShell TAB_SETS handles it)
- Move Create Internal Role button to page header in roles/index.tsx
Pages updated: applications, modules, responses, verification-status,
company/create, company/[id], employees/[id]/edit, users/[id]/edit,
users/details/[id], roles/index, roles/[id]/index, roles/[id]/edit,
role-ui-configs, runtime-roles/[roleKey], onboarding-schemas/*,
external/internal-dashboard-management, approval/[id], approval,
jobs/[id], leads/[id], photographer/[id], requirements/[id],
kb/articles/[id], kb/articles/[id]/edit, verification/[id],
verification-status/[id], help/[id], help/support-bridge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 07:37:02 +01:00
|
|
|
<A class="rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors" href="/admin/photographer">Back to Photographer List</A>
|
|
|
|
|
<A class="rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors" href={`/admin/users/details/${params.id}`}>Open User Detail</A>
|
2026-03-19 15:05:13 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
style: apply consistent page header pattern across all admin routes
- Replace text-2xl font-bold with text-xl font-semibold in all page headers
- Replace bg-[#fd6216] orange buttons with bg-[#0a1d37] navy buttons
- Wrap all pages in -mx-6 -mt-6 flex flex-col layout for edge-to-edge headers
- Replace .field/.actions CSS classes with explicit Tailwind utility classes
- Apply data-table/table-card shared CSS classes to remaining list pages
- Remove duplicate tab bar from roles/index.tsx (AdminShell TAB_SETS handles it)
- Move Create Internal Role button to page header in roles/index.tsx
Pages updated: applications, modules, responses, verification-status,
company/create, company/[id], employees/[id]/edit, users/[id]/edit,
users/details/[id], roles/index, roles/[id]/index, roles/[id]/edit,
role-ui-configs, runtime-roles/[roleKey], onboarding-schemas/*,
external/internal-dashboard-management, approval/[id], approval,
jobs/[id], leads/[id], photographer/[id], requirements/[id],
kb/articles/[id], kb/articles/[id]/edit, verification/[id],
verification-status/[id], help/[id], help/support-bridge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 07:37:02 +01:00
|
|
|
<div class="p-6 flex-1">
|
2026-03-19 15:05:13 +01:00
|
|
|
<Show when={profile.loading}>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
<div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Loading photographer...</p></div>
|
2026-03-19 15:05:13 +01:00
|
|
|
</Show>
|
|
|
|
|
<Show when={!profile.loading && !profile()}>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
<div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Photographer not found.</p></div>
|
2026-03-19 15:05:13 +01:00
|
|
|
</Show>
|
|
|
|
|
|
|
|
|
|
<Show when={profile()}>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
<section class="rounded-xl border border-gray-200 bg-white shadow-sm">
|
|
|
|
|
<div class="mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2">
|
2026-03-19 15:14:15 +01:00
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Name</p>
|
|
|
|
|
<p class="kv-value">{name()}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Email</p>
|
|
|
|
|
<p class="kv-value">{profile()!.email || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Phone</p>
|
|
|
|
|
<p class="kv-value">{profile()!.phone || profile()!.phoneNumber || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Location</p>
|
|
|
|
|
<p class="kv-value">{profile()!.location || [profile()!.city, profile()!.state].filter(Boolean).join(', ') || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Gender</p>
|
|
|
|
|
<p class="kv-value">{profile()!.gender || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Experience</p>
|
|
|
|
|
<p class="kv-value">{profile()!.experience || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Availability</p>
|
|
|
|
|
<p class="kv-value">{profile()!.availability || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Permanent Address</p>
|
|
|
|
|
<p class="kv-value">{profile()!.permanentAddress || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Hometown</p>
|
|
|
|
|
<p class="kv-value">{profile()!.hometown || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Pincode</p>
|
|
|
|
|
<p class="kv-value">{profile()!.pincode || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Status</p>
|
|
|
|
|
<p class="kv-value">{profile()!.status || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item">
|
|
|
|
|
<p class="kv-label">Created</p>
|
|
|
|
|
<p class="kv-value">{created() ? new Date(created()).toLocaleString() : '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="kv-item" style="grid-column:1 / -1">
|
|
|
|
|
<p class="kv-label">Portfolio</p>
|
|
|
|
|
<p class="kv-value">{profile()!.portfolio_url || '—'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<Show when={profile()!.languages && profile()!.languages!.length > 0}>
|
|
|
|
|
<div class="kv-item" style="grid-column:1 / -1">
|
|
|
|
|
<p class="kv-label">Languages</p>
|
|
|
|
|
<ul class="notice" style="margin:8px 0 0;padding-left:18px">
|
|
|
|
|
<For each={profile()!.languages!}>
|
|
|
|
|
{(item) => <li>{item.language || 'Unknown'} - {item.proficiency || 'N/A'}</li>}
|
|
|
|
|
</For>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</Show>
|
2026-03-19 15:05:13 +01:00
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</Show>
|
style: apply consistent page header pattern across all admin routes
- Replace text-2xl font-bold with text-xl font-semibold in all page headers
- Replace bg-[#fd6216] orange buttons with bg-[#0a1d37] navy buttons
- Wrap all pages in -mx-6 -mt-6 flex flex-col layout for edge-to-edge headers
- Replace .field/.actions CSS classes with explicit Tailwind utility classes
- Apply data-table/table-card shared CSS classes to remaining list pages
- Remove duplicate tab bar from roles/index.tsx (AdminShell TAB_SETS handles it)
- Move Create Internal Role button to page header in roles/index.tsx
Pages updated: applications, modules, responses, verification-status,
company/create, company/[id], employees/[id]/edit, users/[id]/edit,
users/details/[id], roles/index, roles/[id]/index, roles/[id]/edit,
role-ui-configs, runtime-roles/[roleKey], onboarding-schemas/*,
external/internal-dashboard-management, approval/[id], approval,
jobs/[id], leads/[id], photographer/[id], requirements/[id],
kb/articles/[id], kb/articles/[id]/edit, verification/[id],
verification-status/[id], help/[id], help/support-bridge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 07:37:02 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-03-19 15:05:13 +01:00
|
|
|
</AdminShell>
|
|
|
|
|
);
|
|
|
|
|
}
|