All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.breadcrumbs.DetailBreadcrumbs.tsx Maven / Gradle / Ivy

There is a newer version: 0.80.3
Show newest version
import Breadcrumbs from 'components/breadcrumbs/Breadcrumbs';
import { createDetailCrumbKey } from 'components/view/utils/view';
import Settings from 'helpers/settings';
import { useParams } from 'react-router';

import { Box } from '@mui/material';

import { Crumb } from './Crumb';

const DetailBreadcrumbs = ({label}: {label: string}) => {
  const {detail, id} = useParams()
  const variable     = createDetailCrumbKey(detail,id)
  const crumbs       = Settings.session.read(variable, [])

  if (crumbs.length > 0) {
    crumbs[crumbs.length -1].label = label
  } else {
    crumbs.push({label: label})
  }

  return (
    
      
    
  )
}
  
const Crumbs = ({crumbs}: {crumbs: Crumb[]}) => 
  crumbs.length > 0 ?  : null


export default DetailBreadcrumbs




© 2015 - 2024 Weber Informatics LLC | Privacy Policy