import { jsx } from "react/jsx-runtime";
import react from "react";
import { Button } from "antd";
import { Icon } from "../../../icon/index.mjs";
import { useCompile } from "../../../schema-component/index.mjs";
import { useGetAriaLabelOfSchemaInitializer } from "../../../schema-initializer/hooks/useGetAriaLabelOfSchemaInitializer.mjs";
const SchemaInitializerButton = /*#__PURE__*/ react.memo((props)=>{
    const { style, options, ...others } = props;
    const compile = useCompile();
    const { getAriaLabel } = useGetAriaLabelOfSchemaInitializer();
    return /*#__PURE__*/ jsx(Button, {
        "data-testid": options['data-testid'],
        "aria-label": getAriaLabel(),
        "aria-disabled": "false",
        type: 'dashed',
        style: {
            borderColor: 'var(--colorSettings)',
            color: 'var(--colorSettings)',
            ...style
        },
        icon: 'string' == typeof options.icon ? /*#__PURE__*/ jsx(Icon, {
            type: options.icon
        }) : options.icon,
        ...others,
        children: /*#__PURE__*/ jsx("span", {
            style: {
                overflow: 'hidden',
                textOverflow: 'ellipsis',
                whiteSpace: 'nowrap',
                display: 'inline-block',
                width: '100%',
                verticalAlign: 'bottom'
            },
            children: compile(options.title)
        })
    });
});
SchemaInitializerButton.displayName = 'SchemaInitializerButton(memo)';
export { SchemaInitializerButton };
