File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/components/common/input Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11import clsx from 'clsx'
2- import { ReactNode } from 'react'
32import { FieldValues , UseFormRegister } from 'react-hook-form'
43import { twMerge } from 'tailwind-merge'
54
65export interface TextInputProps
76 extends React . InputHTMLAttributes < HTMLInputElement > {
87 error ?: boolean
98 register ?: ReturnType < UseFormRegister < FieldValues > >
10- startAdornment ?: ReactNode
11- endAdornment ?: ReactNode
9+ startAdornment ?: React . ReactElement
10+ endAdornment ?: React . ReactElement
1211 fullWidth ?: boolean
1312}
1413
@@ -20,8 +19,8 @@ export const TextInput = ({
2019 type = 'text' ,
2120 error = false ,
2221 register,
23- startAdornment = '' ,
24- endAdornment = '' ,
22+ startAdornment,
23+ endAdornment,
2524 className = '' ,
2625 fullWidth = false ,
2726 ...props
@@ -40,7 +39,7 @@ export const TextInput = ({
4039 )
4140
4241 return (
43- < div className = 'relative' >
42+ < div className = { clsx ( 'relative' , fullWidth ? 'w-full' : 'w-min' ) } >
4443 { startAdornment && (
4544 < span className = 'absolute left-14 top-10' > { startAdornment } </ span >
4645 ) }
You can’t perform that action at this time.
0 commit comments