The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type { DevicePlatformAvailability } from "@t3tools/contracts"; |
| 2 | import { useGT } from "gt-react"; |
| 3 | import { Check, Minus } from "lucide-react"; |
| 4 | import { Tooltip, TooltipTrigger, TooltipPopup } from "../ui/tooltip"; |
| 5 | |
| 6 | export function DeviceHostAvailability({ |
| 7 | platforms, |
| 8 | }: { |
| 9 | platforms: ReadonlyArray<DevicePlatformAvailability>; |
| 10 | }) { |
| 11 | const gt = useGT(); |
| 12 | return ( |
| 13 | <div className="flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground"> |
| 14 | {platforms.map((platform) => ( |
| 15 | <Tooltip key={platform.platform}> |
| 16 | <TooltipTrigger render={<span tabIndex={0} className="inline-flex items-center gap-1" />}> |
| 17 | {platform.available ? <Check className="size-3" /> : <Minus className="size-3" />} |
| 18 | {platform.available |
| 19 | ? gt("{platform} available", { |
| 20 | platform: platform.platform === "ios" ? "iOS" : "Android", |
| 21 | }) |
| 22 | : gt("{platform} unavailable", { |
| 23 | platform: platform.platform === "ios" ? "iOS" : "Android", |
| 24 | })} |
| 25 | </TooltipTrigger> |
| 26 | <TooltipPopup> |
| 27 | {platform.reason ?? |
| 28 | gt("{platform} available", { |
| 29 | platform: platform.platform === "ios" ? "iOS" : "Android", |
| 30 | })} |
| 31 | </TooltipPopup> |
| 32 | </Tooltip> |
| 33 | ))} |
| 34 | </div> |
| 35 | ); |
| 36 | } |