import React from 'react' import { type Meta, type StoryObj } from '@storybook/react-vite' import { DocsTemplate } from '../../../.storybook' import OutputForDemo from '../../../.storybook/templates/OutputForDemo' import { notEmpty } from '../../services/HelperServiceTyped' const NotEmptyTemplate = (args: { item: unknown }): React.JSX.Element => { const { item } = args return (
Input Value: {JSON.stringify(item, null, 2)}
) } export default { title: 'Helper Functions/notEmpty', component: NotEmptyTemplate, parameters: { viewMode: 'docs', previewTabs: { canvas: { hidden: true }, }, docs: { page: () => ( <> A function used to check if the argument passed in has a value and is not an empty string (not null,{' '} undefined, or ''). } infoBullets={[ notEmpty is used when you a boolean returned when checking if a variable has a value and is not an empty string. , ]} noArgs noDemo /> ), source: { code: false, }, }, }, argTypes: { item: { control: 'object', description: 'The value to check', }, }, } as Meta type Story = StoryObj const Template: Story = { render: (args) => , } export const Number: Story = { ...Template, args: { item: 10, }, } export const String: Story = { ...Template, args: { item: 'Hello World!', }, } export const EmptyString: Story = { ...Template, args: { item: '', }, } export const Undefined: Story = { ...Template, args: { item: undefined, }, } export const Null: Story = { ...Template, args: { item: null, }, }