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