import React from "react";
import MuiDatePicker from "@/core/components/DataTable/filter/fieldsType/CustomDate/MuiDatePicker";
import { Typography } from "@mui/material";

function CustomDatePicker({
  column,
  filterParameters,
  defaultFilterTranslation,
  handleChange,
}) {
  return (
    <MuiDatePicker
      name={`${column.id}.value`}
      value={filterParameters.value}
      setFieldValue={(name, formattedDate) => {
        handleChange({ ...filterParameters, value: formattedDate });
      }}
      placeholder={column.header}
      helperText={
        <Typography
          variant="button"
          sx={{ color: (theme) => theme.palette.primary.main }}
        >
          نوع فیلتر: {defaultFilterTranslation} (تاریخ)
        </Typography>
      }
    />
  );
}

export default CustomDatePicker;
