// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck

import { UI_DATE_FORMAT } from "@/lib/constants";
import { DatePicker } from "antd";
import { SizeType } from "antd/es/config-provider/SizeContext";
import { Dayjs } from "dayjs";
import { CSSProperties, FocusEventHandler, KeyboardEventHandler } from "react";

export interface ProDatePickerProps {
  style?: CSSProperties;
  format?: string;
  defaultValue?: Dayjs;
  value?: Dayjs;
  size?: SizeType;
  disabled?: boolean;
  onChange?: (value: Dayjs | null, dateString: string) => void;
  placeholder?: string;
  picker?: "date";
  ref?: any;
  onBlur?: FocusEventHandler<HTMLInputElement>;
  onKeyDown?: KeyboardEventHandler;
  className?: string;
  getPopupContainer?: (trigger: HTMLElement) => HTMLElement;
  defaultOpen?: boolean;
  allowClear?: boolean;
}

function ProDatePicker(props: ProDatePickerProps) {
  return (
    <DatePicker
      allowClear={false}
      format={UI_DATE_FORMAT}
      style={{ width: "100%" }}
      disabled={props.disabled}
      onChange={props.onChange}
      suffixIcon={null}
      {...props}
    />
  );
}

export default ProDatePicker;
