import type { Meta, StoryObj } from '@storybook/nextjs' import { useState } from 'react' import EmojiPicker from '.' const meta = { title: 'Base/Data Entry/EmojiPicker', component: EmojiPicker, parameters: { layout: 'fullscreen', docs: { description: { component: 'Modal-based emoji selector that powers the icon picker. Supports search, background swatches, and confirmation callbacks.', }, }, nextjs: { appDirectory: true, navigation: { pathname: '/apps/demo-app/emoji-picker', params: { appId: 'demo-app' }, }, }, }, tags: ['autodocs'], } satisfies Meta export default meta type Story = StoryObj const EmojiPickerDemo = () => { const [open, setOpen] = useState(false) const [selection, setSelection] = useState<{ emoji: string; background: string } | null>(null) return (
Selection preview
          {selection ? JSON.stringify(selection, null, 2) : 'No emoji selected yet.'}
        
{open && ( { setSelection({ emoji, background }) setOpen(false) }} onClose={() => setOpen(false)} /> )}
) } export const Playground: Story = { render: () => , parameters: { docs: { source: { language: 'tsx', code: ` const [open, setOpen] = useState(false) const [selection, setSelection] = useState<{ emoji: string; background: string } | null>(null) return ( <> {open && ( { setSelection({ emoji, background }) setOpen(false) }} onClose={() => setOpen(false)} /> )} ) `.trim(), }, }, }, }