Open History to see the last commit
1import type { EnvironmentMachineKind } from "@t3tools/contracts";
2import { msg, useMessages } from "gt-react-native";
3
4import { SymbolView, type AppSymbolName } from "./ui/AppSymbol";
5
6export const ENVIRONMENT_MACHINE_SYMBOLS = {
7 server: "server.rack",
8 cloud: "cloud",
9 linux: "terminal",
10 desktop: "desktopcomputer",
11 laptop: "laptopcomputer",
12 "mac-mini": "macmini",
13 "mac-studio": "macstudio",
14} as const satisfies Record<EnvironmentMachineKind, AppSymbolName>;
15
16const ENVIRONMENT_MACHINE_KIND_LABELS: Record<EnvironmentMachineKind, string> = {
17 server: msg("Server", { $context: "machine type" }),
18 cloud: msg("Cloud VM"),
19 linux: msg("Linux/WSL"),
20 desktop: msg("Desktop", { $context: "machine type" }),
21 laptop: msg("Laptop"),
22 "mac-mini": msg("Mini PC"),
23 "mac-studio": msg("Workstation"),
24};
25
26export function EnvironmentMachineSymbol(props: {
27 readonly kind: EnvironmentMachineKind;
28 readonly size: number;
29 readonly tintColorClassName: string;
30}) {
31 const m = useMessages();
32 return (
33 <SymbolView
34 accessibilityLabel={m(ENVIRONMENT_MACHINE_KIND_LABELS[props.kind])}
35 name={ENVIRONMENT_MACHINE_SYMBOLS[props.kind]}
36 size={props.size}
37 tintColorClassName={props.tintColorClassName}
38 type="monochrome"
39 />
40 );
41}