'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import { getTranslation } from '@payloadcms/translations';
import React, { Fragment } from 'react';
import { PayloadIcon } from '../../graphics/Icon/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { Link } from '../Link/index.js';
import { RenderCustomComponent } from '../RenderCustomComponent/index.js';
import { StepNavProvider, useStepNav } from './context.js';
import './index.scss';
export { SetStepNav } from './SetStepNav.js';
const baseClass = 'step-nav';
const StepNav = /**
   * @deprecated
   * This prop is deprecated and will be removed in the next major version.
   * Components now import their own `Link` directly from `next/link`.
   */ ({ className, CustomIcon })=>{
    const { i18n } = useTranslation();
    const { stepNav } = useStepNav();
    const { config: { routes: { admin } } } = useConfig();
    const { t } = useTranslation();
    return /*#__PURE__*/ _jsxDEV(Fragment, {
        children: stepNav.length > 0 ? /*#__PURE__*/ _jsxDEV("nav", {
            className: [
                baseClass,
                className
            ].filter(Boolean).join(' '),
            children: [
                /*#__PURE__*/ _jsxDEV(Link, {
                    className: `${baseClass}__home`,
                    href: admin,
                    prefetch: false,
                    tabIndex: 0,
                    children: /*#__PURE__*/ _jsxDEV("span", {
                        title: t('general:dashboard'),
                        children: /*#__PURE__*/ _jsxDEV(RenderCustomComponent, {
                            CustomComponent: CustomIcon,
                            Fallback: /*#__PURE__*/ _jsxDEV(PayloadIcon, {}, void 0, false, {
                                fileName: "src/elements/StepNav/index.tsx",
                                lineNumber: 48,
                                columnNumber: 77
                            }, void 0)
                        }, void 0, false, {
                            fileName: "src/elements/StepNav/index.tsx",
                            lineNumber: 48,
                            columnNumber: 15
                        }, this)
                    }, void 0, false, {
                        fileName: "src/elements/StepNav/index.tsx",
                        lineNumber: 47,
                        columnNumber: 13
                    }, this)
                }, void 0, false, {
                    fileName: "src/elements/StepNav/index.tsx",
                    lineNumber: 46,
                    columnNumber: 11
                }, this),
                /*#__PURE__*/ _jsxDEV("span", {
                    children: "/"
                }, void 0, false, {
                    fileName: "src/elements/StepNav/index.tsx",
                    lineNumber: 51,
                    columnNumber: 11
                }, this),
                stepNav.map((item, i)=>{
                    const StepLabel = getTranslation(item.label, i18n);
                    const isLast = stepNav.length === i + 1;
                    const Step = isLast ? /*#__PURE__*/ _jsxDEV("span", {
                        className: `${baseClass}__last`,
                        children: StepLabel
                    }, i, false, {
                        fileName: "src/elements/StepNav/index.tsx",
                        lineNumber: 57,
                        columnNumber: 15
                    }, this) : /*#__PURE__*/ _jsxDEV(Fragment, {
                        children: [
                            item.url ? /*#__PURE__*/ _jsxDEV(Link, {
                                href: item.url,
                                prefetch: false,
                                children: /*#__PURE__*/ _jsxDEV("span", {
                                    children: StepLabel
                                }, i, false, {
                                    fileName: "src/elements/StepNav/index.tsx",
                                    lineNumber: 64,
                                    columnNumber: 21
                                }, this)
                            }, void 0, false, {
                                fileName: "src/elements/StepNav/index.tsx",
                                lineNumber: 63,
                                columnNumber: 19
                            }, this) : /*#__PURE__*/ _jsxDEV("span", {
                                children: StepLabel
                            }, i, false, {
                                fileName: "src/elements/StepNav/index.tsx",
                                lineNumber: 67,
                                columnNumber: 19
                            }, this),
                            /*#__PURE__*/ _jsxDEV("span", {
                                children: "/"
                            }, void 0, false, {
                                fileName: "src/elements/StepNav/index.tsx",
                                lineNumber: 69,
                                columnNumber: 17
                            }, this)
                        ]
                    }, i, true, {
                        fileName: "src/elements/StepNav/index.tsx",
                        lineNumber: 61,
                        columnNumber: 15
                    }, this);
                    return Step;
                })
            ]
        }, void 0, true, {
            fileName: "src/elements/StepNav/index.tsx",
            lineNumber: 45,
            columnNumber: 9
        }, this) : /*#__PURE__*/ _jsxDEV("div", {
            className: [
                baseClass,
                className
            ].filter(Boolean).join(' '),
            children: /*#__PURE__*/ _jsxDEV("div", {
                className: `${baseClass}__home`,
                children: /*#__PURE__*/ _jsxDEV("span", {
                    title: t('general:dashboard'),
                    children: /*#__PURE__*/ _jsxDEV(RenderCustomComponent, {
                        CustomComponent: CustomIcon,
                        Fallback: /*#__PURE__*/ _jsxDEV(PayloadIcon, {}, void 0, false, {
                            fileName: "src/elements/StepNav/index.tsx",
                            lineNumber: 80,
                            columnNumber: 77
                        }, void 0)
                    }, void 0, false, {
                        fileName: "src/elements/StepNav/index.tsx",
                        lineNumber: 80,
                        columnNumber: 15
                    }, this)
                }, void 0, false, {
                    fileName: "src/elements/StepNav/index.tsx",
                    lineNumber: 79,
                    columnNumber: 13
                }, this)
            }, void 0, false, {
                fileName: "src/elements/StepNav/index.tsx",
                lineNumber: 78,
                columnNumber: 11
            }, this)
        }, void 0, false, {
            fileName: "src/elements/StepNav/index.tsx",
            lineNumber: 77,
            columnNumber: 9
        }, this)
    }, void 0, false, {
        fileName: "src/elements/StepNav/index.tsx",
        lineNumber: 43,
        columnNumber: 5
    }, this);
};
export { StepNav, StepNavProvider, useStepNav };

//# sourceMappingURL=index.js.map