Skip to content

Commit

Permalink
Merge pull request #5 from momja/nextjs-migration
Browse files Browse the repository at this point in the history
Fix linting error with type
  • Loading branch information
momja committed Dec 3, 2023
2 parents e261d9b + 96f6d86 commit 1f74717
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/iconComponentMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import meetup from '@/public/icon/meetup.svg';
import present from '@/public/icon/present.svg';
import defaultIcon from '@/public/icon/default.svg';
import at_symbol from '@/public/icon/at_symbol.svg';
import { StaticImport } from 'next/dist/shared/lib/get-img-props';

const iconComponentMap: Map<string, JSX.Element> = new Map([
['meetup', meetup],
['present', present],
['at_symbol', at_symbol],
]);

export function getIconComponent(iconName: string): JSX.Element {
export function getIconComponent(iconName: string): StaticImport {
return iconComponentMap.get(iconName) ?? defaultIcon;
}

0 comments on commit 1f74717

Please sign in to comment.