-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathAssignmentLabel.tsx
More file actions
20 lines (15 loc) · 663 Bytes
/
AssignmentLabel.tsx
File metadata and controls
20 lines (15 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { AssignmentCode } from '@wca/helpers';
import { useTranslation } from 'react-i18next';
import { getAssignmentColorClasses } from '@/lib/colors';
import { BaseAssignmentPill } from '../Pill';
interface AssignmentLabelProps {
assignmentCode: AssignmentCode;
}
export function AssignmentLabel({ assignmentCode }: AssignmentLabelProps) {
const { t } = useTranslation();
const name = t(`common.assignments.${assignmentCode}.noun`, {
defaultValue: assignmentCode.replace('staff-', ''),
});
const colorClasses = getAssignmentColorClasses(assignmentCode);
return <BaseAssignmentPill className={colorClasses.bg}>{name}</BaseAssignmentPill>;
}