Open History to see the last commit
1import type { EnvironmentMachineKind } from "@t3tools/contracts";
2import type { SFSymbol } from "expo-symbols";
3
4import { SymbolView } from "./AppSymbol";
5
6const SYMBOL_BY_KIND: Record<EnvironmentMachineKind, SFSymbol> = {
7 server: "server.rack",
8 cloud: "cloud",
9 desktop: "desktopcomputer",
10 laptop: "laptopcomputer",
11 "mac-mini": "macmini",
12 "mac-studio": "macstudio",
13};
14
15export const ENVIRONMENT_MACHINE_KIND_LABELS: Record<EnvironmentMachineKind, string> = {
16 server: "Server",
17 cloud: "Cloud VM",
18 desktop: "Desktop",
19 laptop: "Laptop",
20 "mac-mini": "Mac mini",
21 "mac-studio": "Mac Studio",
22};
23
24/** The glyph an environment wears in lists; SF Symbols on iOS, Tabler on Android. */
25export function EnvironmentMachineSymbol(props: {
26 readonly kind: EnvironmentMachineKind;
27 readonly size: number;
28 readonly tintColorClassName: string;
29}) {
30 return (
31 <SymbolView
32 accessibilityLabel={ENVIRONMENT_MACHINE_KIND_LABELS[props.kind]}
33 name={SYMBOL_BY_KIND[props.kind]}
34 size={props.size}
35 tintColorClassName={props.tintColorClassName}
36 type="monochrome"
37 />
38 );
39}