PHP 8.2.30
Preview: breadcrumbs.js Size: 2.87 KB
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/frontend/components/app/breadcrumbs.js

import { Box, cssClass, Text } from '@adminjs/design-system';
import { styled } from '@adminjs/design-system/styled-components';
import React from 'react';
import { Link } from 'react-router-dom';
import ViewHelpers from '../../../backend/utils/view-helpers/view-helpers.js';
import allowOverride from '../../hoc/allow-override.js';
import { useTranslation } from '../../hooks/use-translation.js';
import { getActionElementCss } from '../../utils/index.js';
export const BreadcrumbLink = styled(Link)`
  color: ${({
  theme
}) => theme.colors.grey60};
  font-family: ${({
  theme
}) => theme.font};
  line-height: ${({
  theme
}) => theme.lineHeights.default};
  font-size: ${({
  theme
}) => theme.fontSizes.default};
  text-decoration: none;

  &:hover {
    color: ${({
  theme
}) => theme.colors.primary100};
    &:after {
      color: ${({
  theme
}) => theme.colors.grey60};
    }
  }

  &:after {
    content: '/';
    padding: 0 ${({
  theme
}) => theme.space.default};
  }

  &:last-child {
    color: ${({
  theme
}) => theme.colors.text};
    &:after {
      content: '';
    }
  }
`;
export const BreadcrumbText = styled(Text)`
  color: ${({
  theme
}) => theme.colors.grey100};
  font-family: ${({
  theme
}) => theme.font};
  font-weight: ${({
  theme
}) => theme.fontWeights.normal.toString()};
  line-height: ${({
  theme
}) => theme.lineHeights.default};
  font-size: ${({
  theme
}) => theme.fontSizes.default};
  cursor: pointer;
  display: inline;

  &:after {
    content: '/';
    padding: 0 ${({
  theme
}) => theme.space.default};
  }

  &:last-child {
    &:after {
      content: '';
    }
  }
`;

/**
 * @memberof Breadcrumbs
 */

/**
 * @component
 * @private
 */
const Breadcrumbs = props => {
  const {
    resource,
    record,
    actionName
  } = props;
  const listAction = resource.resourceActions.find(({
    name
  }) => name === 'list');
  const action = resource.actions.find(a => a.name === actionName);
  const h = new ViewHelpers();
  const {
    tl,
    ta
  } = useTranslation();
  const contentTag = getActionElementCss(resource.id, actionName, 'breadcrumbs');
  return /*#__PURE__*/React.createElement(Box, {
    flexGrow: 1,
    className: cssClass('Breadcrumbs'),
    "data-css": contentTag
  }, /*#__PURE__*/React.createElement(BreadcrumbLink, {
    to: h.dashboardUrl()
  }, tl('dashboard')), listAction ? /*#__PURE__*/React.createElement(BreadcrumbLink, {
    to: resource.href ? resource.href : '/',
    className: record ? 'is-active' : ''
  }, tl(resource.name, resource.id)) : /*#__PURE__*/React.createElement(BreadcrumbText, null, tl(resource.name, resource.id)), action && action.name !== 'list' && /*#__PURE__*/React.createElement(BreadcrumbLink, {
    to: "#"
  }, ta(action.label)));
};
const OverridableBreadcrumbs = allowOverride(Breadcrumbs, 'Breadcrumbs');
export { OverridableBreadcrumbs as default, OverridableBreadcrumbs as Breadcrumbs, Breadcrumbs as OriginalBreadcrumbs };

Directory Contents

Dirs: 6 × Files: 17

Name Size Perms Modified Actions
- drwxr-xr-x 2026-02-28 00:31:42
Edit Download
- drwxr-xr-x 2026-02-28 00:31:50
Edit Download
- drwxr-xr-x 2026-02-28 00:31:44
Edit Download
- drwxr-xr-x 2026-02-28 00:31:48
Edit Download
sidebar DIR
- drwxr-xr-x 2026-02-28 00:31:50
Edit Download
utils DIR
- drwxr-xr-x 2026-02-28 00:31:48
Edit Download
335 B lrw-r--r-- 2026-02-28 00:29:12
Edit Download
303 B lrw-r--r-- 2026-02-28 00:31:14
Edit Download
481 B lrw-r--r-- 2026-02-28 00:31:14
Edit Download
2.43 KB lrw-r--r-- 2026-02-28 00:31:14
Edit Download
2.87 KB lrw-r--r-- 2026-02-28 00:31:22
Edit Download
6.16 KB lrw-r--r-- 2026-02-28 00:31:26
Edit Download
3.20 KB lrw-r--r-- 2026-02-28 00:31:28
Edit Download
1.02 KB lrw-r--r-- 2026-02-28 00:31:28
Edit Download
2.15 KB lrw-r--r-- 2026-02-28 00:31:28
Edit Download
3.87 KB lrw-r--r-- 2026-02-28 00:31:30
Edit Download
238 B lrw-r--r-- 2026-02-28 00:31:34
Edit Download
775 B lrw-r--r-- 2026-02-28 00:31:44
Edit Download
971 B lrw-r--r-- 2026-02-28 00:31:46
Edit Download
2.61 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
1.40 KB lrw-r--r-- 2026-02-28 00:31:50
Edit Download
1.72 KB lrw-r--r-- 2026-02-28 00:31:50
Edit Download
1.13 KB lrw-r--r-- 2026-02-28 00:31:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).