import { Trans } from '@kit/ui/trans';

import SelectAnalysisPackage, {
  AnalysisPackageWithVariant,
} from './select-analysis-package';

export default function SelectAnalysisPackages({
  analysisPackages,
  countryCode,
}: {
  analysisPackages: AnalysisPackageWithVariant[];
  countryCode: string;
}) {
  return (
    <div className="grid gap-6 sm:grid-cols-3">
      {analysisPackages.length > 0 ? (
        analysisPackages.map((analysisPackage) => (
          <SelectAnalysisPackage
            key={analysisPackage.title}
            analysisPackage={analysisPackage}
            countryCode={countryCode}
          />
        ))
      ) : (
        <h4>
          <Trans i18nKey="order-analysis-package:noPackagesAvailable" />
        </h4>
      )}
    </div>
  );
}
