UNPKG

@lucsoft/webgen

Version:

Collection of lucsofts Components

23 lines (22 loc) 905 B
import { custom, span } from "../Components"; export const Icon = (icon, ...classList) => { const webgenIcon = globalThis.WEBGEN_ICON; if (webgenIcon == "material") return custom("span", icon, "material-icons-round", "webgen-icon", ...classList); else if (webgenIcon == "bootstrap") return custom("span", undefined, "bi", "bi-" + icon, "webgen-icon", ...classList); else return span(""); }; export const CommonIcon = (icon) => { const webgenIcon = globalThis.WEBGEN_ICON; let mapping = { [0 /* ArrowDown */]: ["expand_more", "chevron-down"], [1 /* Done */]: ["done", "check2"], [2 /* Close */]: ["close", "x-lg"], [3 /* Download */]: ["get_app", "cloud-download"], [4 /* Edit */]: ["edit", "pencil"], [5 /* Delete */]: ["delete", "trash"] }; return mapping[icon][webgenIcon == "material" ? 0 : 1]; };