Files
test_task_crm/frontend/src/components/crm/deal-status-badge.tsx
T
Artem Kashaev 8718df9686 feat: add deals, tasks, and organizations pages with CRUD functionality
- Implemented DealsPage with deal creation, updating, and filtering features.
- Added OrganizationsPage to manage and switch between organizations.
- Created TasksPage for task management, including task creation and filtering.
- Updated router to include new pages for navigation.
2025-12-01 13:46:56 +05:00

23 lines
634 B
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, type BadgeProps } from '@/components/ui/badge'
import type { DealStatus } from '@/types/crm'
export const dealStatusLabels: Record<DealStatus, string> = {
new: 'Новая',
in_progress: 'В работе',
won: 'Успех',
lost: 'Закрыта',
}
const statusVariant: Record<DealStatus, BadgeProps['variant']> = {
new: 'warning',
in_progress: 'secondary',
won: 'success',
lost: 'destructive',
}
interface DealStatusBadgeProps {
status: DealStatus
}
export const DealStatusBadge = ({ status }: DealStatusBadgeProps) => <Badge variant={statusVariant[status]}>{dealStatusLabels[status]}</Badge>