import type { Meta, StoryObj } from "@storybook/react"; import React from "react"; import { GenerationInstructions } from "@amplicode/storybook-extensions"; import { Admin, defaultI18nProvider, Resource, useNotify } from "react-admin"; import { delayDataProvider } from "../../dataProvider"; import { Box, Button, Typography } from "@mui/material"; const meta = { title: "Notifications/useNotify", parameters: { docs: { canvas: {}, }, layout: "centered", }, } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: () => { const notify = useNotify(); const handleClick = () => { notify(`Action successfully accepted`, { type: "success" }); }; return ( This hook returns a function that displays a notification at the bottom of the page. ); }, decorators: [(Story: () => React.JSX.Element) => defaultDecorator(Story)], }; const defaultDecorator = (Story: () => JSX.Element) => ( );