import { ComponentPropsWithoutRef } from "react"; import Icons from "./icons"; /* var osMap = map[string]string{ "arch": "arch", "ubuntu": "ubuntu", "kali": "kali", "raspbian": "raspbian", "pop": "pop", "debian": "debian", "fedora": "fedora", "centos": "centos", "alpine": "alpine", "mint": "mint", "suse": "suse", "darwin": "macos", "windows": "windows", "msys": "windows", "linux": "linux", } */ const icons: Record = { ubuntu: { name: "ubuntu" }, debian: { name: "debian" }, arch: { name: "arch" }, mint: { name: "linux-mint" }, raspbian: { name: "raspberry-pi" }, fedora: { name: "fedora" }, centos: { name: "centos" }, macos: { name: "apple" }, windows: { name: "microsoft-windows" }, linux: { name: "linux" }, }; type OSIconsProps = Omit, "name"> & { name?: string | null; fallback?: string; }; const OSIcons = ({ name, fallback, ...props }: OSIconsProps) => { const icon = icons[name || ""]; if (!icon) { return fallback ? : null; } return ( ); }; export default OSIcons;