import type React from 'react';
import { useImperativeHandle, useState } from 'react';
import ModalPlugin from '@/components/ModalPlugin';
import type { IRef } from '@/utils/type';

interface IProps extends IRef {}

export type IUserEditModalType = {
  show: () => void;
};

export const UserEditModal: React.FC<IProps> = (props) => {
  console.log(props.ref);
  const [open, setOpen] = useState(false);

  useImperativeHandle(props.ref, () => ({
    show: () => {
      setOpen(true);
    },
  }));
  return (
    <ModalPlugin open={open} onCancel={() => setOpen(false)}>
      11111
    </ModalPlugin>
  );
};
