import type { Meta, StoryObj } from '@storybook/nextjs' import { useState } from 'react' import { FeaturesProvider } from '.' import NewFeaturePanel from './new-feature-panel' import type { Features } from './types' const DEFAULT_FEATURES: Features = { moreLikeThis: { enabled: false }, opening: { enabled: false }, suggested: { enabled: false }, text2speech: { enabled: false }, speech2text: { enabled: false }, citation: { enabled: false }, moderation: { enabled: false }, file: { enabled: false }, annotationReply: { enabled: false }, } const meta = { title: 'Base/Other/FeaturesProvider', component: FeaturesProvider, parameters: { layout: 'fullscreen', docs: { description: { component: 'Zustand-backed provider used for feature toggles. Paired with `NewFeaturePanel` for workflow settings.', }, }, }, tags: ['autodocs'], } satisfies Meta export default meta type Story = StoryObj const FeaturesDemo = () => { const [show, setShow] = useState(true) const [features, setFeatures] = useState(DEFAULT_FEATURES) return (
Feature toggles preview
setFeatures(prev => ({ ...prev, ...next }))} onClose={() => setShow(false)} />
) } export const Playground: Story = { render: () => , args: { children: null, }, }