|
| 1 | +/* eslint-disable react/prop-types */ |
| 2 | +import { CircleArrowRight } from 'lucide-react'; |
| 3 | +import React, { Fragment } from 'react'; |
| 4 | +import { Link as MuiLink, Typography } from '@mui/material'; |
| 5 | +import { AppBar } from '../../../components/AppBar'; |
| 6 | + |
| 7 | +export default { |
| 8 | + title: 'Molecule/Breadcrumb Bar', |
| 9 | + component: AppBar, |
| 10 | + parameters: { |
| 11 | + layout: 'fullscreen', |
| 12 | + }, |
| 13 | +}; |
| 14 | + |
| 15 | +const MockBreadcrumb = ({ workspaceName, scenarioName }) => ( |
| 16 | + <Fragment> |
| 17 | + <MuiLink underline="hover" color="inherit" href="#"> |
| 18 | + <Typography fontSize={14}>{workspaceName}</Typography> |
| 19 | + </MuiLink> |
| 20 | + |
| 21 | + {scenarioName && ( |
| 22 | + <Fragment> |
| 23 | + <CircleArrowRight size={14} /> |
| 24 | + <MuiLink underline="hover" color="inherit" href="#"> |
| 25 | + <Typography fontSize={14}>Scenarios</Typography> |
| 26 | + </MuiLink> |
| 27 | + </Fragment> |
| 28 | + )} |
| 29 | + |
| 30 | + {scenarioName && ( |
| 31 | + <> |
| 32 | + <CircleArrowRight size={14} /> |
| 33 | + <MuiLink underline="hover" color="inherit" href="#"> |
| 34 | + <Typography fontSize={14}>{scenarioName}</Typography> |
| 35 | + </MuiLink> |
| 36 | + </> |
| 37 | + )} |
| 38 | + </Fragment> |
| 39 | +); |
| 40 | + |
| 41 | +const Template = (args) => ( |
| 42 | + <AppBar currentScenario={args.currentScenario}> |
| 43 | + <MockBreadcrumb {...args} /> |
| 44 | + </AppBar> |
| 45 | +); |
| 46 | + |
| 47 | +export const Default = Template.bind({}); |
| 48 | +Default.args = { |
| 49 | + workspaceName: 'Logistics Optimization', |
| 50 | + scenarioName: 'Baseline Scenario', |
| 51 | + currentScenario: { data: { name: 'Baseline Scenario' } }, |
| 52 | +}; |
| 53 | + |
| 54 | +export const WorkspaceOnly = Template.bind({}); |
| 55 | +WorkspaceOnly.args = { |
| 56 | + workspaceName: 'Asset Aip Workspaces', |
| 57 | + scenarioName: null, |
| 58 | + currentScenario: null, |
| 59 | +}; |
| 60 | + |
| 61 | +export const LongNames = Template.bind({}); |
| 62 | +LongNames.args = { |
| 63 | + workspaceName: 'Very Long Workspace Name To Test UI Layout', |
| 64 | + scenarioName: 'Extremely Detailed Scenario', |
| 65 | + currentScenario: { data: { name: 'Extremely Detailed Scenario Title Mock For Visual Testing Purposes' } }, |
| 66 | +}; |
0 commit comments