import { Badge, BadgeVariant, Icon, css } from '@mongodb-js/compass-components';
import React from 'react';
const collectionHeaderBadgeStyles = css({
whiteSpace: 'nowrap',
});
export type CollectionBadgeType =
| 'readonly'
| 'timeseries'
| 'view'
| 'fle'
| 'clustered';
const badges: Record<
CollectionBadgeType,
{ label: React.ReactNode; variant?: BadgeVariant }
> = {
readonly: {
label: 'READ-ONLY',
variant: BadgeVariant.LightGray,
},
timeseries: {
label: (
<>
TIME-SERIES
>
),
},
view: {
label: (
<>
VIEW
>
),
},
fle: {
label: (
<>
{/* Queryable Encryption is the user-facing name of FLE2 */}
Queryable Encryption
>
),
},
clustered: {
label: 'CLUSTERED',
},
};
export const CollectionBadge = ({ type }: { type: CollectionBadgeType }) => {
const { label, variant } = badges[type];
return (
{label}
);
};