feat: Unified icon picker (#7038)
This commit is contained in:
13
shared/utils/icon.ts
Normal file
13
shared/utils/icon.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { IconType } from "../types";
|
||||
import { IconLibrary } from "./IconLibrary";
|
||||
|
||||
const outlineIconNames = new Set(Object.keys(IconLibrary.mapping));
|
||||
|
||||
export const determineIconType = (
|
||||
icon?: string | null
|
||||
): IconType | undefined => {
|
||||
if (!icon) {
|
||||
return;
|
||||
}
|
||||
return outlineIconNames.has(icon) ? IconType.Outline : IconType.Emoji;
|
||||
};
|
||||
Reference in New Issue
Block a user