From 9ef33d72d3df435a928e4957c5869ff67948ff3e Mon Sep 17 00:00:00 2001 From: Ardeman Date: Sat, 1 Mar 2025 06:32:20 +0800 Subject: [PATCH] feat: refactor Input component to use Headless UI and add disabled prop --- app/components/ui/input.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/components/ui/input.tsx b/app/components/ui/input.tsx index 3a7ee75..490954d 100644 --- a/app/components/ui/input.tsx +++ b/app/components/ui/input.tsx @@ -1,3 +1,4 @@ +import { Field, Label, Input as UIInput } from '@headlessui/react' import { useState, type ComponentProps, type ReactNode } from 'react' import { get, @@ -33,6 +34,7 @@ export const Input = >( rules, type = 'text', placeholder, + disabled, ...rest } = properties const [inputType, setInputType] = useState(type) @@ -45,15 +47,15 @@ export const Input = >( const error: FieldError = get(errors, name) return ( -
-
+ ) }