import React, { useState } from "react"; import classNames from "classnames"; import { useConfig } from "../_util/config-context"; import { Modal } from "../modal"; import { Justify } from "../justify"; import { Button } from "../button"; import { StyledProps } from "../_type"; import { useTranslation } from "../i18n"; import { callBoth } from "../util"; export interface VideoProps extends StyledProps { /** * 视频地址 * * *请填写**腾讯云大学**视频地址* */ src?: string; /** * 自定义弹窗内容,优先级低于src */ content?: React.ReactNode; /** * 弹窗标题 */ title?: string; /** * 被包裹内容 */ children: React.ReactNode; } /** * 图片预览 */ export const Video = React.forwardRef(function Video( props: VideoProps, ref: React.Ref ) { const { classPrefix } = useConfig(); const t = useTranslation(); const { src, content, children, title, className, style = {}, ...restProps } = props; const [visible, setVisible] = useState(false); return ( <>
setVisible(true), (restProps as any).onClick)} > {children}
setVisible(false)} onExited={() => setVisible(false)} >
{title} } right={
{ src &&