import type { Meta, StoryObj } from '@storybook/nextjs-vite'; import { Database, FileText, Inbox, Plus, Search, Settings, Sparkles, Upload, Zap } from 'lucide-react'; import React from 'react'; import { MingoIcon } from '../components/icons'; import { Button } from '../components/ui/button'; import { NoData, NoDataAction, NoDataActions, NoDataMessage } from '../components/ui/no-data'; const meta = { title: 'UI/EmptyState', component: NoData, argTypes: { icon: { control: false }, actions: { control: false }, button: { control: false }, buttonIcon: { control: false }, onButtonClick: { control: false }, buttonProps: { control: false }, title: { control: 'text' }, description: { control: 'text' }, buttonLabel: { control: 'text' }, }, } satisfies Meta; export default meta; type Story = StoryObj; const noop = () => {}; const mingoButtonIcon = ( ); const defaultActions = [ { icon: , label: 'Feature Description' }, { icon: , label: 'Feature Description' }, { icon: , label: 'Feature Description' }, ]; // === Full composition === export const Default: Story = { args: { icon: , title: 'No data available', description: 'Start by adding an item', actions: defaultActions, buttonLabel: 'Ask Mingo about Item', buttonIcon: mingoButtonIcon, onButtonClick: noop, }, }; // === Reduced message === export const MessageTitleOnly: Story = { args: { icon: , title: 'No results found', }, }; // === Without one region === export const WithoutActions: Story = { args: { icon: , title: 'No data available', description: 'Start by adding an item', buttonLabel: 'Add item', buttonIcon: , onButtonClick: noop, }, }; export const WithoutButton: Story = { args: { icon: , title: 'No data available', description: 'Start by adding an item', actions: defaultActions, }, }; // === Dynamic block count === export const TwoActions: Story = { args: { icon: , title: 'No data available', description: 'Start by adding an item', actions: [ { icon: , label: 'Feature Description' }, { icon: , label: 'Feature Description' }, ], buttonLabel: 'Ask Mingo about Item', buttonIcon: mingoButtonIcon, onButtonClick: noop, }, }; export const FourActions: Story = { args: { icon: , title: 'No data available', description: 'Start by adding an item', actions: [ { icon: , label: 'Real-time sync' }, { icon: , label: 'Smart suggestions' }, { icon: , label: 'Unlimited storage' }, { icon: , label: 'Export anywhere' }, ], buttonLabel: 'Ask Mingo about Item', buttonIcon: mingoButtonIcon, onButtonClick: noop, }, }; // === Footer button variations === export const ButtonAsLink: Story = { args: { icon: , title: 'No data available', description: 'Import your first dataset', buttonLabel: 'View docs', buttonIcon: , buttonProps: { href: '/docs' }, }, }; export const CustomButton: Story = { args: { icon: , title: 'No data available', description: 'Configure a source to get started', // `button` is the escape hatch — pass any node. button: (
), }, }; // === Standalone parts === export const StandaloneActions: Story = { args: { title: '' }, render: () => ( } label="Info block" /> } label="Info block" /> } label="Info block" /> ), }; export const StandaloneMessage: Story = { args: { title: '' }, render: () => ( } title="No results found" description="Try adjusting your filters" /> ), }; // === Showcase === export const Showcase: Story = { args: { title: '' }, render: () => (
} title="No data available" description="Start by adding an item" actions={defaultActions} buttonLabel="Ask Mingo about Item" buttonIcon={mingoButtonIcon} onButtonClick={noop} /> } title="No results found" description="Try a different search" /> } title="No data available" description="Start by adding an item" actions={defaultActions} />
), };