diff --git a/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.stories.tsx b/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.stories.tsx index ba460e7..d905c4a 100644 --- a/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.stories.tsx +++ b/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.stories.tsx @@ -80,7 +80,7 @@ export const SmallWithFolderIcon: Story = { name: 'Small with folder icon', args: { size: 'small', - iconType: 'folder', + icon: 'folder', }, }; @@ -88,7 +88,7 @@ export const SmallWithFileIcon: Story = { name: 'Small with file icon', args: { size: 'small', - iconType: 'file', + icon: 'file', }, }; @@ -96,6 +96,6 @@ export const SmallWithFileErrorIcon: Story = { name: 'Small with file error icon', args: { size: 'small', - iconType: 'file-error', + icon: 'file-error', }, }; diff --git a/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.tsx b/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.tsx index a37a34b..1c66270 100644 --- a/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.tsx +++ b/src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.tsx @@ -5,16 +5,13 @@ import * as React from 'react'; import { classNames as cx, type ComponentProps } from '../../../util/componentUtil.ts'; -import { assertUnreachable } from '../../../util/types.ts'; -import { Icon } from '../Icon/Icon.tsx'; +import { Icon, type IconName } from '../Icon/Icon.tsx'; import cl from './PlaceholderEmpty.module.scss'; export { cl as PlaceholderEmptyClassNames }; -export type PlaceholderEmptyIconType = 'graph' | 'folder' | 'file' | 'file-error'; - export type PlaceholderEmptySize = 'large' | 'small'; export type PlaceholderEmptyProps = React.PropsWithChildren & { @@ -25,7 +22,7 @@ export type PlaceholderEmptyProps = React.PropsWithChildren { const { unstyled = false, size = 'large', - iconType = 'graph', + icon = 'graph', customIcon = null, title = '', subtitle = '', @@ -55,16 +52,6 @@ export const PlaceholderEmpty = (props: PlaceholderEmptyProps) => { ...propsRest } = props; - const icon = ((): PlaceholderEmptyIconType => { - switch (iconType) { - case 'graph': return 'graph'; - case 'folder': return 'folder'; - case 'file': return 'file'; - case 'file-error': return 'file-error'; - default: throw assertUnreachable(iconType); - } - })(); - return (