import type { Meta, StoryObj } from '@storybook/nextjs'
import { useState } from 'react'
import Flowchart from '.'
const SAMPLE = `
flowchart LR
A[User Message] --> B{Agent decides}
B -->|Needs tool| C[Search Tool]
C --> D[Combine result]
B -->|Direct answer| D
D --> E[Send response]
`
const MermaidDemo = ({
theme = 'light',
}: {
theme?: 'light' | 'dark'
}) => {
const [currentTheme, setCurrentTheme] = useState<'light' | 'dark'>(theme)
return (
Mermaid diagram
)
}
const meta = {
title: 'Base/Data Display/Mermaid',
component: MermaidDemo,
parameters: {
layout: 'centered',
docs: {
description: {
component: 'Mermaid renderer with custom theme toggle and caching. Useful for visualizing agent flows.',
},
},
},
argTypes: {
theme: {
control: 'inline-radio',
options: ['light', 'dark'],
},
},
args: {
theme: 'light',
},
tags: ['autodocs'],
} satisfies Meta
export default meta
type Story = StoryObj
export const Playground: Story = {}