formatting
This commit is contained in:
parent
0471443716
commit
4b28a69856
1 changed files with 2438 additions and 1874 deletions
|
|
@ -1,27 +1,39 @@
|
|||
import { Badge } from '@mantine/core'
|
||||
import { Badge } from "@mantine/core";
|
||||
|
||||
export type AnnotationVariant = 'audience' | 'readOnly' | 'destructive' | 'longRun' | 'priority' | 'default'
|
||||
export type AnnotationVariant =
|
||||
| "audience"
|
||||
| "readOnly"
|
||||
| "destructive"
|
||||
| "longRun"
|
||||
| "priority"
|
||||
| "default";
|
||||
|
||||
export interface AnnotationBadgeProps {
|
||||
label: string
|
||||
variant?: AnnotationVariant
|
||||
label: string;
|
||||
variant?: AnnotationVariant;
|
||||
}
|
||||
|
||||
const variantMap: Record<AnnotationVariant, { color: string; variant: string }> = {
|
||||
audience: { color: 'gray', variant: 'outline' },
|
||||
readOnly: { color: 'dark', variant: 'filled' },
|
||||
destructive: { color: 'red', variant: 'outline' },
|
||||
longRun: { color: 'yellow', variant: 'outline' },
|
||||
priority: { color: 'orange', variant: 'light' },
|
||||
default: { color: 'gray', variant: 'light' },
|
||||
}
|
||||
const variantMap: Record<
|
||||
AnnotationVariant,
|
||||
{ color: string; variant: string }
|
||||
> = {
|
||||
audience: { color: "gray", variant: "outline" },
|
||||
readOnly: { color: "dark", variant: "filled" },
|
||||
destructive: { color: "red", variant: "outline" },
|
||||
longRun: { color: "yellow", variant: "outline" },
|
||||
priority: { color: "orange", variant: "light" },
|
||||
default: { color: "gray", variant: "light" },
|
||||
};
|
||||
|
||||
export function AnnotationBadge({ label, variant = 'default' }: AnnotationBadgeProps) {
|
||||
const { color, variant: badgeVariant } = variantMap[variant]
|
||||
export function AnnotationBadge({
|
||||
label,
|
||||
variant = "default",
|
||||
}: AnnotationBadgeProps) {
|
||||
const { color, variant: badgeVariant } = variantMap[variant];
|
||||
|
||||
return (
|
||||
<Badge color={color} variant={badgeVariant}>
|
||||
{label}
|
||||
</Badge>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue