All files / react-app/src/components/SupportPage statusLabel.tsx

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28        77x                                   77x          
import { cva, type VariantProps } from "class-variance-authority";
 
import { cn } from "@/utils";
 
const statusLabelVariants = cva("px-2 mr-2 font-light text-white rounded-[2px]", {
  variants: {
    type: {
      New: "bg-blue-700",
      Updated: "bg-green-700",
    },
  },
  defaultVariants: {
    type: "New",
  },
});
 
export type StatusLabelVariant = "New" | "Updated";
 
interface StatusLabelProps extends VariantProps<typeof statusLabelVariants> {
  className?: string;
}
 
const StatusLabel = ({ type, className }: StatusLabelProps) => {
  return <span className={cn(statusLabelVariants({ type }), className)}>{type}</span>;
};
 
export default StatusLabel;