'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import React from 'react';
import './index.scss';
import { Link } from '../../elements/Link/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { formatAdminURL } from '../../utilities/formatAdminURL.js';
import { sanitizeID } from '../../utilities/sanitizeID.js';
import { useDrawerDepth } from '../Drawer/index.js';
const baseClass = 'id-label';
export const IDLabel = ({ id, className, prefix = 'ID:' })=>{
    const { config: { routes: { admin: adminRoute } } } = useConfig();
    const { collectionSlug, globalSlug } = useDocumentInfo();
    const drawerDepth = useDrawerDepth();
    const docPath = formatAdminURL({
        adminRoute,
        path: `/${collectionSlug ? `collections/${collectionSlug}` : `globals/${globalSlug}`}/${id}`
    });
    return /*#__PURE__*/ _jsxDEV("div", {
        className: [
            baseClass,
            className
        ].filter(Boolean).join(' '),
        title: id,
        children: [
            prefix,
            " ",
            drawerDepth > 1 ? /*#__PURE__*/ _jsxDEV(Link, {
                href: docPath,
                children: sanitizeID(id)
            }, void 0, false, {
                fileName: "src/elements/IDLabel/index.tsx",
                lineNumber: 37,
                columnNumber: 26
            }, this) : sanitizeID(id)
        ]
    }, void 0, true, {
        fileName: "src/elements/IDLabel/index.tsx",
        lineNumber: 34,
        columnNumber: 5
    }, this);
};

//# sourceMappingURL=index.js.map