import { Button, Tooltip } from 'antd'; import { UploadBox, UploadBoxProps, UploadChangeInfo } from './UploadBox'; import { Block } from '@/index'; import { useDownload } from '@/hooks/useDownload'; import { cn } from '@/utils/cn'; import { ImageFormat } from 'fabric'; import locale from '@/locale'; export type DownloadProps = { format?: ImageFormat; filename?: string; }; export function Operators({ blocks, uploadProps, downloadProps, onChange, className, }: { blocks: Block[]; uploadProps?: UploadBoxProps; downloadProps?: DownloadProps; onChange: (info: UploadChangeInfo) => void; className?: string; }) { const { visible = !!blocks.length, hidden = false } = uploadProps || {}; const { format = 'png', filename } = downloadProps || {}; const { run: download, loading: downloading } = useDownload(); return ( ); }