import { Scale } from 'lucide-react';

import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n';
import { Button } from '@kit/ui/button';
import SelectAnalysisPackages from '@/components/select-analysis-packages';
import { PageBody } from '@kit/ui/page';
import { Trans } from '@kit/ui/trans';

import ComparePackagesModal from '../../_components/compare-packages-modal';

export const generateMetadata = async () => {
  const i18n = await createI18nServerInstance();
  const title = i18n.t('order-analysis-package:title');

  return {
    title,
  };
};

async function OrderAnalysisPackagePage() {
  return (
    <PageBody>
      <div className="space-y-3 text-center">
        <h3>
          <Trans i18nKey={'marketing:selectPackage'} />
        </h3>
        <ComparePackagesModal
          triggerElement={
            <Button variant="secondary" className="gap-2">
              <Trans i18nKey={'marketing:comparePackages'} />
              <Scale className="size-4 stroke-[1.5px]" />
            </Button>
          }
        />
      </div>
      <SelectAnalysisPackages />
    </PageBody>
  );
}

export default withI18n(OrderAnalysisPackagePage);
