import { HomeLayoutPageHeader } from '@/app/home/(user)/_components/home-page-header';
import { loadCategory } from '@/app/home/(user)/_lib/server/load-category';

import { AppBreadcrumbs } from '@kit/ui/makerkit/app-breadcrumbs';
import { PageBody } from '@kit/ui/page';
import { Trans } from '@kit/ui/trans';

import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n';

export const generateMetadata = async () => {
  const i18n = await createI18nServerInstance();
  const title = i18n.t('booking:title');

  return {
    title,
  };
};

async function BookingHandlePage({ params }: { params: { handle: string } }) {
  const handle = await params.handle;
  const { category } = await loadCategory({ handle });

  return (
    <>
      <AppBreadcrumbs
        values={{
          [handle]: category?.name || handle,
        }}
      />
      <HomeLayoutPageHeader
        title={<Trans i18nKey={'booking:title'} />}
        description={<Trans i18nKey={'booking:description'} />}
      />

      <PageBody></PageBody>
    </>
  );
}

export default withI18n(BookingHandlePage);
