| 1 | import type { ExecutionEnvironmentPlatformOs, FileManagerRevealKind } from "@t3tools/contracts"; |
| 2 | |
| 3 | export function revealInFileExplorerLabel(platform: string): string { |
| 4 | const normalized = platform.toLowerCase(); |
| 5 | if (normalized.includes("mac")) return "Reveal in Finder"; |
| 6 | if (normalized.includes("win")) return "Reveal in File Explorer"; |
| 7 | return "Reveal in Files"; |
| 8 | } |
| 9 | |
| 10 | /** Same wording keyed by an environment's reported OS rather than a |
| 11 | navigator platform string, for actions that reveal on the server machine. */ |
| 12 | export function revealInFileExplorerLabelForOs(os: ExecutionEnvironmentPlatformOs): string { |
| 13 | if (os === "darwin") return "Reveal in Finder"; |
| 14 | if (os === "windows") return "Reveal in File Explorer"; |
| 15 | return "Reveal in Files"; |
| 16 | } |
| 17 | |
| 18 | /** Server-selected wording, including Windows File Explorer reached from WSL. */ |
| 19 | export function revealInFileExplorerLabelForKind(kind: FileManagerRevealKind): string { |
| 20 | if (kind === "finder") return "Reveal in Finder"; |
| 21 | if (kind === "file-explorer") return "Reveal in File Explorer"; |
| 22 | return "Reveal in Files"; |
| 23 | } |