import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../../schema-component/index.mjs";
const Summary = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)((props)=>{
    const { schema, label } = props;
    const compile = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
    const token = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.useAntdToken)();
    const styles = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
            container: {
                backgroundColor: token.colorFillAlter,
                marginBottom: token.marginLG,
                padding: token.paddingSM + token.paddingXXS
            },
            title: {
                color: token.colorText
            },
            description: {
                marginTop: token.marginXS,
                color: token.colorTextDescription
            },
            tag: {
                background: 'none'
            }
        }), [
        token.colorFillAlter,
        token.colorText,
        token.colorTextDescription,
        token.marginLG,
        token.marginXS,
        token.paddingSM,
        token.paddingXXS
    ]);
    if (!schema) return null;
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
        style: styles.container,
        children: [
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
                style: styles.title,
                children: [
                    label,
                    ": ",
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Tag, {
                        style: styles.tag,
                        children: compile(schema.title)
                    })
                ]
            }),
            schema.description ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                style: styles.description,
                children: compile(schema.description)
            }) : null
        ]
    });
}, {
    displayName: 'Summary'
});
const Summary_rslib_entry_ = Summary;
export { Summary_rslib_entry_ as default };
