refactor(components): derive ImagePicker variant types from buttonVariants

Replace manually duplicated variant/size type literals with
VariantProps<typeof buttonVariants> for type safety and
consistency with the Button component.
This commit is contained in:
2026-04-07 13:11:42 -04:00
parent a7716d87df
commit fab0d2ff47

View File

@@ -1,22 +1,15 @@
"use client";
import type { VariantProps } from "class-variance-authority";
import { ImageIcon } from "lucide-react";
import type React from "react";
import { useRef } from "react";
import { Button } from "@/components/ui/button";
import { ImageIcon } from "lucide-react";
import { Button, type buttonVariants } from "@/components/ui/button";
interface ImagePickerProps {
interface ImagePickerProps extends VariantProps<typeof buttonVariants> {
onFileSelect?: (file: File) => void;
className?: string;
children?: React.ReactNode;
variant?:
| "default"
| "destructive"
| "outline"
| "secondary"
| "ghost"
| "link";
size?: "default" | "sm" | "lg" | "icon";
disabled?: boolean;
}