From fab0d2ff47f74af8553c3da7dd1b28c3acfa9e8b Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Tue, 7 Apr 2026 13:11:42 -0400 Subject: [PATCH] refactor(components): derive ImagePicker variant types from buttonVariants Replace manually duplicated variant/size type literals with VariantProps for type safety and consistency with the Button component. --- src/components/image-picker.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/image-picker.tsx b/src/components/image-picker.tsx index 899477e..2fad2f7 100644 --- a/src/components/image-picker.tsx +++ b/src/components/image-picker.tsx @@ -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 { onFileSelect?: (file: File) => void; className?: string; children?: React.ReactNode; - variant?: - | "default" - | "destructive" - | "outline" - | "secondary" - | "ghost" - | "link"; - size?: "default" | "sm" | "lg" | "icon"; disabled?: boolean; }