From 9bc7faafb8cfcef403467d7bf3f2ba1c8672d81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matth=C3=A4us=20N=C3=B6ssing?= Date: Fri, 15 Sep 2023 16:38:46 +0200 Subject: [PATCH] remove options from placeholder and cleanup --- .../WithPlacehoder.stories.tsx | 20 ++++++------------- .../WithPlaceholder/WithPlaceholder.tsx | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/components/content/WithPlaceholder/WithPlacehoder.stories.tsx b/src/components/content/WithPlaceholder/WithPlacehoder.stories.tsx index 4e2f8e20..ca3e95cf 100644 --- a/src/components/content/WithPlaceholder/WithPlacehoder.stories.tsx +++ b/src/components/content/WithPlaceholder/WithPlacehoder.stories.tsx @@ -10,33 +10,25 @@ import { Meta, StoryObj } from '@storybook/react' import { WithPlaceholder } from './WithPlaceholder' const children = { - options: ['null', 'undefined', 'empty', 'text'], + options: ['null', 'undefined', 'Empty text', 'ReactNode'], mapping: { - 'null': null, - 'undefined': undefined, + null: null, + undefined: undefined, 'Empty text': '', - 'ReactNode': 'John Doe', + ReactNode: 'John Doe', }, control: { type: 'select' }, } -const placeholder = { - options: ['default', 'star', 'notFound'], - mapping: { - default: '-', - star: '*', - notFound: 'Not found', - }, -} const meta = { title: 'Components/Content/WithPlaceHolder', component: WithPlaceholder, args: { - children: 'Content', + children: 'John Doe', + placeholder: '-', }, argTypes: { children, - placeholder, }, parameters: { docs: { diff --git a/src/components/content/WithPlaceholder/WithPlaceholder.tsx b/src/components/content/WithPlaceholder/WithPlaceholder.tsx index 2e70ee92..292ce324 100644 --- a/src/components/content/WithPlaceholder/WithPlaceholder.tsx +++ b/src/components/content/WithPlaceholder/WithPlaceholder.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from 'react' +import { PropsWithChildren, ReactNode } from 'react' export type WithPlaceholderProps = PropsWithChildren<{ /**