landscape/util: cast getModuleIcon

This commit is contained in:
Matilde Park 2021-05-04 19:36:47 -04:00
parent a276d42078
commit 36c5f1644b

View File

@ -23,7 +23,9 @@ export const MOMENT_CALENDAR_DATE = {
sameElse: '~YYYY.M.D'
};
export const getModuleIcon = (mod: string): IconRef => {
type GraphModule = 'link' | 'post' | 'chat' | 'publish';
export const getModuleIcon = (mod: GraphModule): IconRef => {
if (mod === 'link') {
return 'Collection';
}
@ -32,7 +34,7 @@ export const getModuleIcon = (mod: string): IconRef => {
return 'Dashboard';
}
return _.capitalize(mod);
return _.capitalize(mod) as IconRef;
};
export function wait(ms: number) {