mnemo_cards/mnemo_cards_admin/src/components/tasks/TaskStatusBadge.tsx
Dmitry 336bafc600
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
tasks and stuff
2026-01-09 20:21:18 +03:00

50 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
)
}