import { jsx } from "react/jsx-runtime";
import "react";
import { useFieldSchema } from "@tachybase/schema";
import { Card } from "antd";
import { useSchemaTemplate } from "../../../schema-templates/index.mjs";
import { BlockItem } from "../block-item/index.mjs";
import style from "./style.mjs";
const CardItem = (props)=>{
    const { children, name, ...restProps } = props;
    const template = useSchemaTemplate();
    const fieldSchema = useFieldSchema();
    const templateKey = null == fieldSchema ? void 0 : fieldSchema['x-template-key'];
    const { styles } = style();
    return templateKey && !template ? null : /*#__PURE__*/ jsx(BlockItem, {
        name: name,
        className: "".concat(styles, " tb-card-item"),
        children: /*#__PURE__*/ jsx(Card, {
            className: "card",
            bordered: false,
            ...restProps,
            children: props.children
        })
    });
};
export { CardItem };
