workout-lol.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { cva, type VariantProps } from "class-variance-authority";
  2. import { cn } from "@/shared/lib/utils";
  3. const workoutLolVariants = cva(
  4. "inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-sm font-mono font-semibold transition-colors duration-200",
  5. {
  6. variants: {
  7. variant: {
  8. default: [
  9. "bg-red-50 text-red-600 ring-1 ring-inset ring-red-200",
  10. "dark:bg-red-950/30 dark:text-red-400 dark:ring-red-900/30",
  11. "hover:bg-red-100 dark:hover:bg-red-950/50",
  12. ],
  13. muted: [
  14. "bg-slate-100 text-slate-600 ring-1 ring-inset ring-slate-200",
  15. "dark:bg-slate-900/50 dark:text-slate-400 dark:ring-slate-800",
  16. "hover:bg-slate-200 dark:hover:bg-slate-900/70",
  17. ],
  18. },
  19. },
  20. defaultVariants: {
  21. variant: "default",
  22. },
  23. },
  24. );
  25. interface WorkoutLolProps extends VariantProps<typeof workoutLolVariants> {
  26. className?: string;
  27. children?: React.ReactNode;
  28. }
  29. export const WorkoutLol = ({ className, variant, children }: WorkoutLolProps) => {
  30. return <span className={cn(workoutLolVariants({ variant }), className)}>{children || "workout.lol"}</span>;
  31. };
  32. export const WorkoutLolMuted = ({ className, children }: Omit<WorkoutLolProps, "variant">) => (
  33. <WorkoutLol className={className} variant="muted">
  34. {children}
  35. </WorkoutLol>
  36. );