import React from 'react'; import { MinusIcon, CheckCircleIcon, ArchiveBoxIcon, ArrowPathIcon } from '@heroicons/react/24/solid'; import { useTranslation } from 'react-i18next'; import { StatusType } from '../../entities/Task'; interface TaskStatusBadgeProps { status: StatusType | number; className?: string; } const TaskStatusBadge: React.FC = ({ status, className }) => { const { t } = useTranslation(); // Convert numeric status to string const getStatusString = (status: StatusType | number): StatusType => { if (typeof status === 'number') { const statusNames: StatusType[] = ['not_started', 'in_progress', 'done', 'archived']; return statusNames[status] || 'not_started'; } return status; }; const statusString = getStatusString(status); let statusIcon, statusLabel; switch (statusString) { case 'not_started': statusIcon = ; statusLabel = t('status.notStarted', 'Not Started'); break; case 'in_progress': statusIcon = ; statusLabel = t('status.inProgress', 'In Progress'); break; case 'done': statusIcon = ; statusLabel = t('status.done', 'Done'); break; case 'archived': statusIcon = ; statusLabel = t('status.archived', 'Archived'); break; default: statusIcon = ; statusLabel = t('status.unknown', 'Unknown'); } return (
{statusIcon} {/* {statusLabel} */}
); }; export default TaskStatusBadge;