import { A, useParams } from '@solidjs/router'; import { For, 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; phoneNumber?: string; location?: string; gender?: string; availability?: string; permanentAddress?: string; hometown?: string; pincode?: string; languages?: Array<{ language?: string; proficiency?: 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 fallback.json(); const photographerRes = await fetch(`${API}/api/photographers/${id}`); if (!photographerRes.ok) return null; return photographerRes.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 || profile()!.phoneNumber || '—'}

Location

{profile()!.location || [profile()!.city, profile()!.state].filter(Boolean).join(', ') || '—'}

Gender

{profile()!.gender || '—'}

Experience

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

Availability

{profile()!.availability || '—'}

Permanent Address

{profile()!.permanentAddress || '—'}

Hometown

{profile()!.hometown || '—'}

Pincode

{profile()!.pincode || '—'}

Status

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

Created

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

Portfolio

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

0}>

Languages

    {(item) =>
  • {item.language || 'Unknown'} - {item.proficiency || 'N/A'}
  • }
); }