import type { Meta, StoryObj } from '@storybook/react-vite'
import { useState } from 'react'
import { IconFolder, IconMessage } from '@tabler/icons-react'
import { AppProvider } from './AppProvider'
import { Link } from './Link'
import { MembersPill } from './MembersPill'
import { NavItem } from './NavItem'
import { Person } from './Person'
/** One picture the app "knows": Ana's. Inline, so the story needs nothing from anywhere. */
const ANA = 'data:image/svg+xml;utf8,'
const pictureFor = (name: string) => (name === 'Ana Duarte' ? ANA : undefined)
const meta = {
title: 'Frame/AppProvider',
component: AppProvider,
args: { children: null },
argTypes: { children: { control: false }, pictureFor: { control: false }, navigate: { control: false } },
} satisfies Meta
export default meta
type Story = StoryObj
/**
* The app knows Ana's picture and nobody else's. No part below is handed a
* picture: each face asks the app, and Ravi, whom it does not know, keeps
* his initials.
*/
export const Pictures: Story = {
render: () => (
{}} />
),
}
/**
* A click on a row or a link goes through the app's `navigate`, and the page
* is not loaded again. The line under them says where the last click went.
*/
export const ChangingPage: Story = {
render: function ChangingPage() {
const [at, setAt] = useState('/topics')
return (