Add document classification
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Badge } from "../../Atoms/Badge/Badge";
|
||||
import { getDocumentClassificationLabel } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
|
||||
type Props = {
|
||||
classification: string;
|
||||
};
|
||||
|
||||
export function DocumentClassificationBadge({ classification }: Props) {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
// Choose badge variant based on classification level
|
||||
const variant = (() => {
|
||||
switch (classification) {
|
||||
case "PUBLIC":
|
||||
return "success" as const;
|
||||
case "INTERNAL":
|
||||
return "neutral" as const;
|
||||
case "CONFIDENTIAL":
|
||||
return "warning" as const;
|
||||
case "SECRET":
|
||||
return "danger" as const;
|
||||
default:
|
||||
return "neutral" as const;
|
||||
}
|
||||
})();
|
||||
|
||||
return (
|
||||
<Badge variant={variant}>
|
||||
{getDocumentClassificationLabel(__, classification)}
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
@@ -66,6 +66,7 @@ export { MeasureBadge } from "./Molecules/Badge/MeasureBadge";
|
||||
export { MeasureImplementation } from "./Molecules/MeasureImplementation/MeasureImplementation";
|
||||
export { FrameworkSelector } from "./Molecules/FrameworkSelector/FrameworkSelector";
|
||||
export { DocumentTypeBadge } from "./Molecules/Badge/DocumentTypeBadge";
|
||||
export { DocumentClassificationBadge } from "./Molecules/Badge/DocumentClassificationBadge";
|
||||
export { SentitivityOptions } from "./Molecules/Select/SentitivityOptions";
|
||||
export { ImpactOptions } from "./Molecules/Select/ImpactOptions";
|
||||
export { DurationPicker } from "./Molecules/DurationPicker/DurationPicker";
|
||||
|
||||
Reference in New Issue
Block a user