gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/components/boolean-pill/index.tsx · v0.3.1
Source
1 d377c4c Dawsh 2y ago import type { FC } from "react";
2 d377c4c Dawsh 2y ago import { Badge } from "@marzneshin/components";
3 d377c4c Dawsh 2y ago
4 d377c4c Dawsh 2y ago interface BooleanPillProps {
5 d377c4c Dawsh 2y ago active: boolean;
6 d377c4c Dawsh 2y ago activeLabel: string;
7 d377c4c Dawsh 2y ago inactiveLabel: string;
8 d377c4c Dawsh 2y ago }
9 d377c4c Dawsh 2y ago
10 d377c4c Dawsh 2y ago export const BooleanPill: FC<BooleanPillProps> = ({ active, activeLabel, inactiveLabel }) => {
11 d377c4c Dawsh 2y ago return (
12 d377c4c Dawsh 2y ago <Badge variant={active ? "positive" : "destructive"}>
13 d377c4c Dawsh 2y ago {active ? activeLabel : inactiveLabel}
14 d377c4c Dawsh 2y ago </Badge>
15 d377c4c Dawsh 2y ago )
16 d377c4c Dawsh 2y ago }