'use server';

import React from 'react';

import { Spinner } from '@kit/ui/makerkit/spinner';
import { Trans } from '@kit/ui/makerkit/trans';
import { Progress } from '@kit/ui/shadcn/progress';

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

const AnalysisFallback = ({
  progress,
  progressTextKey,
}: {
  progress: number;
  progressTextKey: string;
}) => {
  return (
    <div className="flex flex-col items-center justify-center gap-4 py-10">
      <Trans i18nKey={progressTextKey} />
      <Spinner />
      <Progress value={progress} />
    </div>
  );
};

export default withI18n(AnalysisFallback);
