import { Select } from '@pikku/mantine/core';
import type { DB } from '@heygermany/sdk';
import { DocumentStatuses } from '@heygermany/sdk';
import { useI18n } from '@/context/i18n-provider';

interface DocumentStatusSelectProps {
  value: DB.DocumentStatus;
  onChange: (value: DB.DocumentStatus) => void;
}

export const DocumentStatusSelect: React.FC<DocumentStatusSelectProps> = ({
  value,
  onChange
}) => {
  const t = useI18n();
  return (
    <Select
      placeholder={t('backoffice.candidate.fields.selectstatus')}
      value={value}
      onChange={(value) => onChange(value as DB.DocumentStatus)}
      data={[
        { value: DocumentStatuses.UNVERIFIED, label: t('backoffice.documents.status.unverified') },
        { value: DocumentStatuses.VERIFIED, label: t('backoffice.documents.status.verified') },
        { value: DocumentStatuses.INVALID, label: t('backoffice.documents.status.invalid') },
        { value: DocumentStatuses.MISSING, label: t('backoffice.documents.status.missing') }
      ]}
    />
  );
};
