Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Web App CI / test (push) Waiting to run
Web App CI / build (push) Blocked by required conditions
Deploy Admin Panel / Deploy Admin Panel (push) Waiting to run
Deploy Admin Panel / Admin Panel Verification (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Deploy Telegram Bot / Deploy Telegram Bot (push) Waiting to run
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { Badge } from '@/components/ui/badge'
|
||
import { cn } from '@/lib/utils'
|
||
import type { TaskDto } from '@/types/models'
|
||
|
||
interface TaskStatusBadgeProps {
|
||
status: TaskDto['status']
|
||
className?: string
|
||
}
|
||
|
||
export function TaskStatusBadge({ status, className }: TaskStatusBadgeProps) {
|
||
const statusConfig = {
|
||
available: {
|
||
label: 'Доступна',
|
||
variant: 'default' as const,
|
||
className: 'bg-green-500 hover:bg-green-600 text-white border-transparent',
|
||
},
|
||
in_progress: {
|
||
label: 'В процессе',
|
||
variant: 'default' as const,
|
||
className: 'bg-blue-500 hover:bg-blue-600 text-white border-transparent',
|
||
},
|
||
completed: {
|
||
label: 'Завершена',
|
||
variant: 'default' as const,
|
||
className: 'bg-purple-500 hover:bg-purple-600 text-white border-transparent',
|
||
},
|
||
expired: {
|
||
label: 'Истекла',
|
||
variant: 'secondary' as const,
|
||
className: 'bg-gray-500 hover:bg-gray-600 text-white border-transparent',
|
||
},
|
||
failed: {
|
||
label: 'Провалена',
|
||
variant: 'destructive' as const,
|
||
className: 'bg-red-500 hover:bg-red-600 text-white border-transparent',
|
||
},
|
||
}
|
||
|
||
const config = statusConfig[status]
|
||
|
||
return (
|
||
<Badge
|
||
variant={config.variant}
|
||
className={cn(config.className, className)}
|
||
>
|
||
{config.label}
|
||
</Badge>
|
||
)
|
||
}
|
||
|