searchInput value및 setText 이벤트를 받도록 수정

This commit is contained in:
YangJinSoo94
2025-03-20 17:43:16 +09:00
parent 9ea9dc5e32
commit f0f2665981
@@ -1,14 +1,15 @@
import { Input, Label } from "@common/components";
import React from "react";
const SearchInput = React.forwardRef<
HTMLDivElement& HTMLInputElement,
React.HTMLAttributes<HTMLDivElement> & {className:string, label:string}>
(({className, label}, ref) => {
const SearchInput = React.forwardRef<HTMLInputElement, {className:string, label:string, textValue:string, setText:(val:string)=>void}>(({className, label, textValue, setText}, ref) => {
const changeText=(e:React.ChangeEvent<HTMLInputElement>)=>{
if(e?.target?.value) setText(e.target.value)
}
return (
<div className={className+" flex"} >
{label && <Label className="m-4 text-2xl w-1/4">{label}</Label>}
<Input className="ml-8 w-3/4 text-lg" ref={ref}></Input>
<Input className="ml-8 w-3/4 text-lg" value={textValue} onChange={changeText}></Input>
</div>
)
});