import { useCallback } from "react";
import { useFieldSchema } from "@tachybase/schema";
import { useCollection_deprecated } from "../../collection-manager/index.mjs";
const useGetAriaLabelOfDesigner = ()=>{
    const fieldSchema = useFieldSchema();
    const { name: _collectionName } = useCollection_deprecated();
    const getAriaLabel = useCallback((name, postfix)=>{
        if (!fieldSchema) return '';
        const component = fieldSchema['x-component'];
        const designer = fieldSchema['x-designer'] ? "-".concat(fieldSchema['x-designer']) : '';
        const settings = fieldSchema['x-settings'] ? "-".concat(fieldSchema['x-settings']) : '';
        const collectionField = fieldSchema['x-collection-field'] ? "-".concat(fieldSchema['x-collection-field']) : '';
        const collectionName = _collectionName ? "-".concat(_collectionName) : '';
        postfix = postfix ? "-".concat(postfix) : '';
        return "designer-".concat(name, "-").concat(component).concat(designer).concat(settings).concat(collectionName).concat(collectionField).concat(postfix);
    }, [
        fieldSchema,
        _collectionName
    ]);
    return {
        getAriaLabel
    };
};
export { useGetAriaLabelOfDesigner };
