| 1 | import { AppWindow } from "lucide-react"; |
| 2 | import { siAndroid, siApple, siLinux } from "simple-icons"; |
| 3 | |
| 4 | import type { PlatformId } from "../lib/download-platform"; |
| 5 | |
| 6 | /** |
| 7 | * A platform's mark, in the text's colour: Apple's for macOS and iOS, |
| 8 | * Linux's and Android's from Simple Icons. Simple Icons has no Windows |
| 9 | * mark, so Windows has Lucide's window. |
| 10 | */ |
| 11 | export function PlatformMark({ platform, size = 16, className }: { platform: PlatformId; size?: number; className?: string }) { |
| 12 | if (platform === "windows") return <AppWindow size={size} className={className} aria-hidden="true" />; |
| 13 | const path = platform === "linux" ? siLinux.path : platform === "android" ? siAndroid.path : siApple.path; |
| 14 | return ( |
| 15 | <svg viewBox="0 0 24 24" width={size} height={size} fill="currentColor" aria-hidden="true" className={className}> |
| 16 | <path d={path} /> |
| 17 | </svg> |
| 18 | ); |
| 19 | } |