import { MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { Button, Input } from "antd";
import { useCallback, useEffect} from "react";
import _ from "lodash";
import { useMainContext } from "../layout/MainProvider";
import StaffTable from "./stafftable/page";

export default function StaffMessage() {
  const { form, formValue, setFormValue, setVisible, setSearchValue, editingRecord } = useMainContext();

  useEffect(() => {
    setFormValue({
      username: "",
      deptId: "",
      absent: false,
      positionId: "",
      trainSituations: "",
    });
  }, []);

  const handleNew = () => {
    form.setFieldsValue(formValue);
    setVisible(true);
  };

  const handleSearch = useCallback(
    _.debounce((value: string) => {
      setSearchValue(value);
    }, 500),
    []
  );

  return (
    <>
          <StaffTable />
    </>
  );
}

