import type { Meta, StoryObj } from '@storybook/react-vite' import React, { useState } from 'react' import { DocsTemplate } from '../../../.storybook' import { SpreadsheetPane } from './SpreadsheetPane' const meta: Meta = { title: 'Components/Spreadsheet/SpreadsheetPane', component: SpreadsheetPane, parameters: { docs: { page: () => ( The SpreadsheetPane component serves as a companion container designed to work seamlessly with a{' '} Spreadsheet. It is specifically tailored to display information tied to the Spreadsheet data, such as errors, suggested changes, or actions that can directly impact the contents of the Spreadsheet. This component enhances the user's ability to interact with and manage the data within the{' '} Spreadsheet. } /> ), }, }, decorators: [ (Story) => (
), ], } export default meta type Story = StoryObj const Template: Story = { render: function Render(args) { const [collapsed, setCollapsed] = useState(false) return ( ) }, } export const Basic: Story = { ...Template, args: { headerText: 'Header here', children: ({ collapsed }) => !collapsed ? (
This would be a message to promote an action. Content Here
) : ( <> ), tooltipInfo: 'Tooltip info here', subHeader: { label: 'Subheader label', data: 'Data Here', check: true, }, }, } export const WithoutTooltip: Story = { ...Template, args: { headerText: 'Header here', children: ({ collapsed }) => !collapsed ? (
This would be a message to promote an action. No informational tooltip above.
) : ( <> ), subHeader: { label: 'Subheader label', data: 'Data Here', check: true, }, }, } export const WithoutSubHeader: Story = { ...Template, args: { headerText: 'Header here', children: ({ collapsed }) => !collapsed ? (
This would be a message to promote an action. No informational tooltip above.
) : ( <> ), }, } export const WithTooltipButWithoutSubHeader: Story = { ...Template, args: { headerText: 'Header here', children: ({ collapsed }) => !collapsed ? (
This would be a message to promote an action. No informational tooltip above.
) : ( <> ), tooltipInfo: 'Tooltip info here', }, } const loremIpsum = () => { return Array.from({ length: 50 }, (_, index) => (
Lorem ipsum line {index + 1}
)) } export const LargeContent: Story = { ...Template, args: { headerText: 'Header here', subHeader: { label: 'Subheader label', data: 'Data Here', check: true, }, children: ({ collapsed }) => !collapsed ? (
Content section can be scrolled.
{loremIpsum()}
) : ( <> ), }, }