gitscope
← marzneshin / v0.5.5 / dashboard/src/components/boolean-pill/index.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/components/boolean-pill/index.tsx · TypeScript
Blame Raw
 1import type { FC } from "react";
 2import { Badge, BadgeVariantKeys } from "@marzneshin/components";
 3
 4interface BooleanPillProps {
 5    active: boolean;
 6    activeLabel: string;
 7    activeVariant?: BadgeVariantKeys;
 8    inactiveLabel: string;
 9    inactiveVariant?: BadgeVariantKeys;
10}
11
12export const BooleanPill: FC<BooleanPillProps> = ({
13    active,
14    activeLabel,
15    inactiveLabel,
16    activeVariant = "positive",
17    inactiveVariant = "destructive"
18}) => {
19    return (
20        <Badge variant={active ? activeVariant : inactiveVariant}>
21            {active ? activeLabel : inactiveLabel}
22        </Badge>
23    )
24}