import { useState } from "react";
import TextField from "@mui/material/TextField";
import { NumericFormat } from "react-number-format";

function SalaryInput() {
    const [displayValue, setDisplayValue] = useState('');
    return (
        <NumericFormat
            customInput={ TextField }
            label='Gaji Bulanan'
            variant="outlined"
            valueIsNumericString={true}
            thousandSeparator={true}
            value={displayValue}
            onValueChange={(value, sourceInfo) => {setDisplayValue(value.value)}}
            InputProps={{
                startAdornment: <span>Rp</span>
            }}
        />
    );
}

export default SalaryInput;
