Skip to content

Commit

Permalink
🔥 remove unused fallback jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-unterberg committed Jan 1, 2024
1 parent 4e1e508 commit 5e8caa5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ interface AppIconProps extends LucideProps {
icon: ICON_ID
}

const IconFallback = ({ className }: { className: string }) => <div className={className} />

const Icon = ({ icon, ...props }: AppIconProps) => {
const [Component, setComponent] = useState<React.ComponentType<LazyIconIconProps>>(() => '')

Expand All @@ -19,10 +17,8 @@ const Icon = ({ icon, ...props }: AppIconProps) => {

if (icon) {
return (
<div className={props?.className || ''} style={{ width: props.size, height: props.size }}>
<Suspense fallback={<IconFallback className={props?.className || ''} />}>
{Component && <Component icon={icon} {...props} />}
</Suspense>
<div className={props.className || ''} style={{ width: props.size, height: props.size }}>
<Suspense fallback="">{Component && <Component icon={icon} {...props} />}</Suspense>
</div>
)
}
Expand Down

0 comments on commit 5e8caa5

Please sign in to comment.