"use client"; import type React from "react"; import { Label } from "@/components/ui/label"; import { generateID } from "@/lib/form-helper"; export type Size = "sm" | "md" | "lg"; export type Shadow = "sm" | "none"; const sizeClass = { sm: "px-3 py-1.5", md: "px-4 py-2", lg: "px-5 py-3", }; const shadowClass = { sm: "shadow-sm", none: "shadow-none", }; interface InputWithLabelProps { label?: string; value?: string; id?: string; placeholder?: string; disabled?: boolean; required?: boolean; size?: Size; suffix?: React.ReactNode; prefix?: React.ReactNode; shadow?: Shadow; className?: string; onChange?: (e: React.ChangeEvent) => void; } const Input: React.FC = ({ label, value, placeholder = "", disabled = false, required = false, id = generateID(), size = "md", suffix, prefix, shadow = "none", className = "", onChange, }) => { const borderClass = "border border-slate-200 border-b-slate-300 dark:border-zinc-800 dark:border-t-zinc-700"; return (
{label && ( )}
{prefix && (
{prefix}
)} {suffix && (
{suffix}
)}
); }; export { Input };