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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user