'use client';
import { FunctionComponent, PropsWithChildren, useMemo } from 'react';
import { useTranslations } from 'next-intl';
import { ROUTES } from '@/constants';
import { LinkToPage } from '@/utils';
import MobileShell from './MobileShell';

/**
 * Partner-center portal shell (f15) — a **separate authz scope** from the Balinyaar admin console.
 * A center admin is not a Balinyaar admin; they see only their own center's data (server-enforced
 * tenancy, plus each page's own `useMyPartnerCenter` access-denied state). The center's identity
 * and merchant-of-record status moved from the top bar into the «بیشتر» hub, alongside settings.
 * @layout PartnerLayout
 */
const PartnerLayout: FunctionComponent<PropsWithChildren> = ({ children }) => {
  const t = useTranslations('nav');

  const tabs: Array<LinkToPage> = useMemo(
    () => [
      { title: t('partner_home'), path: ROUTES.PARTNER, icon: 'partners' },
      { title: t('partner_nurses'), path: ROUTES.PARTNER_NURSES, icon: 'patients' },
      { title: t('partner_bookings'), path: ROUTES.PARTNER_BOOKINGS, icon: 'bookings' },
      { title: t('partner_settlement'), path: ROUTES.PARTNER_SETTLEMENT, icon: 'earnings' },
      { title: t('more'), path: ROUTES.PARTNER_MORE, icon: 'more' },
    ],
    [t]
  );

  return (
    <MobileShell name="Partner" tabs={tabs}>
      {children}
    </MobileShell>
  );
};

export default PartnerLayout;
