import React from "react"; import Icon from "components/Icon"; interface IPlatformCellProps { value: string[]; } const baseClass = "platform-cell"; const ICONS: Record = { darwin: "darwin", windows: "windows", linux: "linux", chrome: "chrome", }; const DISPLAY_ORDER = [ "darwin", "windows", "linux", "chrome", // "None", // "Invalid query", ]; const PlatformCell = ({ value: platforms, }: IPlatformCellProps): JSX.Element => { const orderedList = DISPLAY_ORDER.filter((platform) => platforms.includes(platform) ); return ( {orderedList.length ? ( orderedList.map((platform) => { return ICONS[platform] ? ( ) : null; }) ) : ( --- )} ); }; export default PlatformCell;