Skip to content

Commit

Permalink
fix: Error with types on Icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChV committed Jul 10, 2024
1 parent 82b496c commit 0a962a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/generic/block-type-utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export const COMPONENT_TYPES = {
dragAndDrop: 'drag-and-drop-v2',
};

export const TYPE_ICONS_MAP: Record<string, React.ReactElement> = {
export const TYPE_ICONS_MAP: Record<string, React.ComponentType> = {
video: VideoCameraIcon,
other: BookOpenIcon,
vertical: FormatListBulletedIcon,
problem: EditIcon,
lock: LockIcon,
};

export const COMPONENT_TYPE_ICON_MAP: Record<string, React.ReactElement> = {
export const COMPONENT_TYPE_ICON_MAP: Record<string, React.ComponentType> = {
[COMPONENT_TYPES.advanced]: ScienceIcon,
[COMPONENT_TYPES.discussion]: QuestionAnswerOutlineIcon,
[COMPONENT_TYPES.library]: LibraryIcon,
Expand All @@ -47,7 +47,7 @@ export const COMPONENT_TYPE_ICON_MAP: Record<string, React.ReactElement> = {
[COMPONENT_TYPES.dragAndDrop]: BackHandIcon,
};

export const STRUCTURAL_TYPE_ICONS: Record<string, React.ReactElement> = {
export const STRUCTURAL_TYPE_ICONS: Record<string, React.ComponentType> = {
vertical: TYPE_ICONS_MAP.vertical,
sequential: Folder,
chapter: Folder,
Expand Down
2 changes: 1 addition & 1 deletion src/generic/block-type-utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
COMPONENT_TYPE_COLOR_MAP,
} from './constants';

export function getItemIcon(blockType: string): React.ReactElement {
export function getItemIcon(blockType: string): React.ComponentType {
return STRUCTURAL_TYPE_ICONS[blockType] ?? COMPONENT_TYPE_ICON_MAP[blockType] ?? Article;
}

Expand Down

0 comments on commit 0a962a0

Please sign in to comment.