import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import { formatAdminURL } from 'payload/shared';
import React from 'react';
import { useConfig } from '../../../providers/Config/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { Link } from '../../Link/index.js';
import { ColoredFolderIcon } from '../ColoredFolderIcon/index.js';
import './index.scss';
const baseClass = 'browse-by-folder-button';
export function BrowseByFolderButton({ active }) {
    const { t } = useTranslation();
    const { config } = useConfig();
    const { admin: { routes: { browseByFolder: foldersRoute } }, routes: { admin: adminRoute } } = config;
    return /*#__PURE__*/ _jsxDEV(Link, {
        className: [
            baseClass,
            active && 'active'
        ].filter(Boolean).join(' '),
        href: formatAdminURL({
            adminRoute,
            path: foldersRoute
        }),
        id: "browse-by-folder",
        prefetch: false,
        children: [
            /*#__PURE__*/ _jsxDEV(ColoredFolderIcon, {}, void 0, false, {
                fileName: "src/elements/FolderView/BrowseByFolderButton/index.tsx",
                lineNumber: 32,
                columnNumber: 7
            }, this),
            t('folder:browseByFolder')
        ]
    }, void 0, true, {
        fileName: "src/elements/FolderView/BrowseByFolderButton/index.tsx",
        lineNumber: 23,
        columnNumber: 5
    }, this);
}

//# sourceMappingURL=index.js.map