import { Button, Card, Collapse, Modal, Popover, Space } from "antd"; import { Typography } from "antd"; import { useState } from "react"; import { CloseOutlined } from "@ant-design/icons"; import type { TDisplayStyle } from "./Article"; import Video from "../general/Video"; import { VideoIcon } from "../../assets/icon"; import type { IAttachmentResponse } from "../../api/Attachments"; import { get } from "../../request"; const { Text } = Typography; const getUrl = async (fileId: string) => { const url = `/v2/attachment/${fileId}`; console.info("url", url); const res = await get(url); if (res.ok) { return res.data.url; } else { return ""; } }; const getLink = async ({ url, id, _____type, _____title }: IVideoCtl) => { let link = url; if (!link && id) { const res = await getUrl(id); link = res; } return link; }; interface IVideoCtl { url?: string; id?: string; type?: string; title?: React.ReactNode; style?: TDisplayStyle; _style?: TDisplayStyle; } const VideoPopover = ({ url, id, type, title }: IVideoCtl) => { const [popOpen, setPopOpen] = useState(false); console.debug("popOpen", popOpen); return ( {title}