import { Palette } from "@hpcc-js/common"; import * as React from "@hpcc-js/preact-shim"; import { Image } from "./image"; import { ImageChar } from "./ImageChar"; import { Shape } from "./shape"; export interface Icon { shape?: "circle" | "square" | "rectangle"; width?: number; height?: number; padding?: number; fill?: string; stroke?: string; strokeWidth?: number; imageUrl?: string; imageFontFamily?: string; imageChar?: string; imageCharFill?: string; xOffset?: number; yOffset?: number; cornerRadius?: number; shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision"; } export const Icon: React.FunctionComponent = ({ shape = "circle", width, height = 32, fill, stroke, strokeWidth = 0, imageUrl = "", imageFontFamily = "FontAwesome", imageChar = "", imageCharFill = Palette.textColor(fill), padding = height / 5, xOffset = 0, yOffset = 0, cornerRadius, shapeRendering }) => { return <> {imageUrl ? : } ; }; export interface IconEx extends Icon { id: string; } export interface Icons { icons: IconEx[]; } export const Icons: React.FunctionComponent = ({ icons = [] }) => { const IconComponents = icons.map(cat => { return ; }); return <>{IconComponents}; };