import { Input } from 'antd';
import React, { useState } from 'react';
import {EditOutlined} from "@ant-design/icons";

const MyComponent = () => {
    const [inputValue, setInputValue] = useState('');

    const handleChange = (e:any) => {
        // Input 값이 변경될 때 상태 업데이트
        setInputValue(e.target.value);
    };

    const setNewValue = () => {
        // 상태를 직접 변경
        setInputValue('New Value');
    };

    return (
        <div>
            <Input
                defaultValue={inputValue}
                prefix={<EditOutlined className="site-form-item-icon" />}
                placeholder="서비스코드"
                value={inputValue}
                onChange={handleChange}
            />
            <button onClick={setNewValue}>Set New Value</button>
        </div>
    );
};
export default MyComponent;