import { A, useParams } from '@solidjs/router'; import { createMemo, createResource, Show } from 'solid-js'; 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; }; async function fetchPhotographer(id: string): Promise { try { const res = await fetch(`${API}/api/admin/users/${id}`); if (res.ok) return res.json(); const fallback = await fetch(`${API}/api/users/${id}`); if (!fallback.ok) return null; return fallback.json(); } 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 (

Photographer Detail

View profile snapshot and account metadata for one photographer.

Loading photographer...

Photographer not found.

Name: {name()}

Email: {profile()!.email || '—'}

Phone: {profile()!.phone || '—'}

Status: {profile()!.status || '—'}

City/State: {[profile()!.city, profile()!.state].filter(Boolean).join(', ') || '—'}

Experience: {profile()!.experience || '—'}

Created: {created() ? new Date(created()).toLocaleString() : '—'}

Portfolio: {profile()!.portfolio_url || '—'}

); }