import type { Meta, StoryObj } from "@storybook/react"; import { email, TextInput, useUnique, } from "react-admin"; import { users } from "../../../../dataProvider"; import { attributeName } from "../../../../ideExtension"; import { Typography } from "@mui/material"; import { AdditionalInfoWrapper, inputDecorators } from "../inputDecorators"; const meta = { title: "Inputs/EmailInput", component: TextInput, parameters: { // layout: "centered", }, decorators: [...inputDecorators], args: { source: "email", }, argTypes: { resettable: { control: "boolean" } } } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: ({ source, validate, ...props }) => { return ( ); }, }; export const UniqueValidation: Story = { render: ({ source, validate, ...props }) => { const unique = useUnique(); return ( ); }, decorators: [ (Story) => { return ( <> Reserved emails
{users.map((user) => { return {user.email}; })}
); }, ], };