import { forwardRef, useImperativeHandle, useState, useRef } from "react";
import { Modal, Flex, Button } from "antd";
import { useMutation } from "@tanstack/react-query";
import { CreateAudioEncode, UpdateAudioEncode } from "../api/audio";
import type { CreateAudioEncodeReq, AudioEncodeItem } from "../types/audioencode";
import { useGlobal } from "../Context";
import ChannelModel, { IChannelModelFunc } from "./channel/Channel";

interface NotificationModalProps {
  title: string;
  onSuccess: () => void;
}

export interface NotificationModalRef {
  open: (task?: AudioEncodeItem) => void;
}

const NotificationModal = forwardRef<NotificationModalRef, NotificationModalProps>(
  ({ title, onSuccess }, ref) => {
    const [open, setOpen] = useState(false);
    const [audioUrl, setAudioUrl] = useState("");

    useImperativeHandle(ref, () => ({
      open: (task?: AudioEncodeItem) => {
        console.log(task);

        setOpen(true);
      },
    }));
    const handleClose = () => {
      setOpen(false);
    };

    return (
      <Modal
        style={{ top: '-180px' }} // 距离顶部 80px（可改为 10% 等百分比）
        title={title}
        open={open}
        onCancel={handleClose}
        centered
        onOk={() => { }}
      >

     
      </Modal>
    );
  }
);

export default NotificationModal;
