import { useState } from 'react'; import { Meta } from '@storybook/react-webpack5'; import { StatusSummaryBar, StatusSegment } from './StatusSummaryBar'; export default { component: StatusSummaryBar, title: 'Design System/StatusSummaryBar', } as Meta; const environmentSegments: StatusSegment[] = [ { key: 'up', label: 'Up', count: 12, color: 'success' }, { key: 'down', label: 'Down', count: 3, color: 'error' }, { key: 'outdated', label: 'Outdated', count: 2, color: 'warning' }, { key: 'unassigned', label: 'Unassigned', count: 5, color: 'gray' }, ]; export function Environments() { const [filter, setFilter] = useState(null); return (
Active filter: {filter}
); } const containerSegments: StatusSegment[] = [ { key: 'running', label: 'Running', count: 45, color: 'success' }, { key: 'stopped', label: 'Stopped', count: 8, color: 'error' }, { key: 'healthy', label: 'Healthy', count: 40, color: 'blue' }, { key: 'unhealthy', label: 'Unhealthy', count: 5, color: 'warning' }, ]; export function Containers() { const [filter, setFilter] = useState(null); return (
Active filter: {filter}
); } export function WithZeroCounts() { const [filter, setFilter] = useState(null); const segments: StatusSegment[] = [ { key: 'up', label: 'Up', count: 5, color: 'success' }, { key: 'down', label: 'Down', count: 0, color: 'error' }, { key: 'outdated', label: 'Outdated', count: 0, color: 'warning' }, ]; return ( ); }