import usePersianInput from "@/lib/hooks/usePersianInput";
import { TextField } from "@mui/material";
import { useRef } from "react";

const PersianTextField = (props) => {
    const { onChange, ...rest } = props;
    const inputRef = useRef(null);

    const handleChange = (value) => {
        onChange(value);
    };

    usePersianInput(inputRef, handleChange);

    return <TextField ref={inputRef} {...rest} />;
};

export default PersianTextField;
