import { ConfigProvider } from "antd";
import classNames from "clsx";
import React, { useContext } from "react";
/**
 * 预览页通用占位容器：用于加载中、错误、不支持等场景
 *
 * 仅承担布局容器职责，具体的 Spin / Alert / 文案由调用方传入 children
 */ export var PlaceholderContent = function PlaceholderContent(param) {
    var children = param.children, showFileInfo = param.showFileInfo, file = param.file, onDownload = param.onDownload, locale = param.locale, prefixCls = param.prefixCls, hashId = param.hashId;
    var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
    var finalPrefixCls = prefixCls || getPrefixCls('workspace-preview');
    return /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(finalPrefixCls, "-placeholder"), hashId)
    }, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(finalPrefixCls, "-placeholder-content"), hashId)
    }, children, showFileInfo && file && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("p", null, (locale === null || locale === void 0 ? void 0 : locale['workspace.file.fileName']) || '文件名：', file.name), file.size && /*#__PURE__*/ React.createElement("p", null, (locale === null || locale === void 0 ? void 0 : locale['workspace.file.fileSize']) || '文件大小：', file.size), onDownload && /*#__PURE__*/ React.createElement("button", {
        type: "button",
        className: classNames("".concat(finalPrefixCls, "-download-button"), hashId),
        onClick: onDownload,
        "aria-label": (locale === null || locale === void 0 ? void 0 : locale['workspace.file.download']) || '下载文件'
    }, (locale === null || locale === void 0 ? void 0 : locale['workspace.file.clickToDownload']) || '点击下载'))));
};
