"use client" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Calendar } from "@/components/ui/calendar" import { Input } from "@/components/ui/input" import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Textarea } from "@/components/ui/textarea" import { cn } from "@/lib/utils" import { SelectProps } from "@radix-ui/react-select" import { format } from "date-fns" import { CalendarIcon } from "lucide-react" import { InputHTMLAttributes, TextareaHTMLAttributes, useState } from "react" type FormInputProps = InputHTMLAttributes & { title: string hideIfEmpty?: boolean } export function FormInput({ title, hideIfEmpty = false, ...props }: FormInputProps) { if (hideIfEmpty && (!props.defaultValue || props.defaultValue.toString().trim() === "") && !props.value) { return null } return ( ) } type FormTextareaProps = TextareaHTMLAttributes & { title: string hideIfEmpty?: boolean } export function FormTextarea({ title, hideIfEmpty = false, ...props }: FormTextareaProps) { if (hideIfEmpty && (!props.defaultValue || props.defaultValue.toString().trim() === "") && !props.value) { return null } return (