// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; import { Button, Grid, StyleRulesCallback, WithStyles, Typography, Tooltip } from '@material-ui/core'; import ChevronRightIcon from '@material-ui/icons/ChevronRight'; import { withStyles } from '@material-ui/core'; import { IllegalNamingWarning } from '../warning/warning'; export interface Breadcrumb { label: string; } type CssRules = "item" | "currentItem" | "label"; const styles: StyleRulesCallback = theme => ({ item: { opacity: 0.6 }, currentItem: { opacity: 1 }, label: { textTransform: "none" } }); export interface BreadcrumbsProps { items: Breadcrumb[]; onClick: (breadcrumb: Breadcrumb) => void; onContextMenu: (event: React.MouseEvent, breadcrumb: Breadcrumb) => void; } export const Breadcrumbs = withStyles(styles)( ({ classes, onClick, onContextMenu, items }: BreadcrumbsProps & WithStyles) => { items.map((item, index) => { const isLastItem = index === items.length - 1; const isFirstItem = index === 0; return ( {isFirstItem ? null : } {!isLastItem && } ); }) } );