'use client'; import { Stack, Typography } from '@mui/material'; import { useLocale, useTranslations } from 'next-intl'; import { AccentCard, AppLink, NavHubList, PageHeader, StatusChip, TrustBadge } from '@/components'; import type { NavHubItem } from '@/components'; import { ROUTES } from '@/constants'; import { useMyVariants } from '@/services/catalog'; import { useServiceAreas } from '@/services/serviceAreas'; import { useNurseProfile } from '@/services/profiles'; import { useVerificationStatus } from '@/services/verification'; import { ownBadgeState } from '@/services/verification/types'; /** * «حرفهٔ من» group root — the page the bottom-nav tab lands on. It answers the question the * sidebar section never could ("is my listing actually live, and what's missing?") before handing * off to the four screens that fix it. Every number here is read off a query that already answers * it; nothing is derived optimistically, and a count is simply omitted until its query resolves. */ export default function NursePracticeScreen() { const t = useTranslations('hub'); const locale = useLocale(); const tn = useTranslations('nav'); const { data: verification } = useVerificationStatus(); const { data: profile } = useNurseProfile(); const { data: variants } = useMyVariants(); const { data: areas } = useServiceAreas(); const activeVariants = variants?.items.filter((variant) => variant.isActive).length; const isAccepting = profile?.isAcceptingBookings; const items: Array = [ { title: tn('profile'), subtitle: t('practice_profile_sub'), icon: 'account', path: ROUTES.NURSE_PROFILE, }, { title: tn('services'), subtitle: t('practice_services_sub'), icon: 'services', path: ROUTES.NURSE_SERVICES, meta: activeVariants === undefined ? undefined : , }, { title: tn('coverage'), subtitle: t('practice_coverage_sub'), icon: 'coverage', path: ROUTES.NURSE_COVERAGE, meta: areas === undefined ? undefined : , }, { title: tn('verification'), subtitle: t('practice_verification_sub'), icon: 'verification', path: ROUTES.NURSE_VERIFICATION, }, ]; return ( {t('practice_status_title')} {isAccepting === undefined ? null : ( {t('practice_accepting_manage')} )} ); } /** A count read straight off a resolved query — never a placeholder while one is in flight. */ function MetaCount({ value }: { value: number }) { return ( {value} ); }