The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { T, useGT } from "gt-react-native"; |
| 2 | import { SymbolView } from "../../components/ui/AppSymbol"; |
| 3 | import { Platform, Pressable, View } from "react-native"; |
| 4 | |
| 5 | import { AppText as Text } from "../../components/ui/AppText"; |
| 6 | import { NewThreadButton } from "../../components/NewThreadButton"; |
| 7 | import { FloatingActionButton } from "../../components/ui/FloatingActionButton"; |
| 8 | import { EmptyState } from "../../components/ui/EmptyState"; |
| 9 | import { ScreenContent } from "../../components/ui/ScreenContent"; |
| 10 | import type { WorkspaceTab } from "./workspace/workspace-tabs-state"; |
| 11 | |
| 12 | export function WorkspaceEmptyDetail(props: { |
| 13 | readonly tab?: WorkspaceTab | "settings"; |
| 14 | readonly onStartNewTask?: () => void; |
| 15 | readonly onAddConnection?: () => void; |
| 16 | }) { |
| 17 | const gt = useGT(); |
| 18 | const pullRequests = props.tab === "pullRequests"; |
| 19 | const issues = props.tab === "issues"; |
| 20 | const settings = props.tab === "settings"; |
| 21 | if (props.tab === "usage") return <View className="flex-1 bg-screen" />; |
| 22 | return ( |
| 23 | <ScreenContent surface="screen"> |
| 24 | <View |
| 25 | className={ |
| 26 | Platform.OS === "android" |
| 27 | ? "flex-1 items-center justify-center px-10" |
| 28 | : "flex-1 items-center justify-center bg-screen px-10" |
| 29 | } |
| 30 | > |
| 31 | {props.onAddConnection ? ( |
| 32 | <View className="w-full max-w-[430px]"> |
| 33 | <EmptyState |
| 34 | title={gt("No environments connected")} |
| 35 | detail={gt("Add an environment to load projects and start coding sessions.")} |
| 36 | variant="plain" |
| 37 | action={ |
| 38 | <FloatingActionButton |
| 39 | label={gt("Add environment")} |
| 40 | icon="plus" |
| 41 | variant="extended" |
| 42 | tone="primary" |
| 43 | onPress={props.onAddConnection} |
| 44 | /> |
| 45 | } |
| 46 | /> |
| 47 | </View> |
| 48 | ) : ( |
| 49 | <View className="max-w-[360px] items-center gap-3"> |
| 50 | <SymbolView |
| 51 | name="sidebar.left" |
| 52 | size={34} |
| 53 | tintColorClassName="accent-icon-subtle" |
| 54 | type="hierarchical" |
| 55 | /> |
| 56 | <Text className="text-center text-xl font-t3-bold"> |
| 57 | {settings |
| 58 | ? gt("Select a setting") |
| 59 | : pullRequests |
| 60 | ? gt("Select a pull request") |
| 61 | : issues |
| 62 | ? gt("Select an issue") |
| 63 | : gt("Select a thread")} |
| 64 | </Text> |
| 65 | <Text className="text-center text-base text-foreground-muted"> |
| 66 | {settings |
| 67 | ? gt("Choose a page from the sidebar.") |
| 68 | : pullRequests |
| 69 | ? gt("Choose a pull request from the sidebar to review it.") |
| 70 | : issues |
| 71 | ? gt("Choose an issue from the sidebar to read it.") |
| 72 | : Platform.OS === "android" |
| 73 | ? gt("Choose a thread from the sidebar or start a new thread.") |
| 74 | : gt("Choose a thread from the sidebar or start a new task.")} |
| 75 | </Text> |
| 76 | {props.onStartNewTask && !pullRequests && !issues && !settings ? ( |
| 77 | Platform.OS === "android" ? ( |
| 78 | <NewThreadButton extended className="mt-2" onPress={props.onStartNewTask} /> |
| 79 | ) : ( |
| 80 | <Pressable |
| 81 | accessibilityRole="button" |
| 82 | className="mt-2 flex-row items-center gap-2 rounded-full bg-primary px-5 py-3 active:opacity-70" |
| 83 | onPress={props.onStartNewTask} |
| 84 | > |
| 85 | <Text className="text-base font-t3-bold text-primary-foreground"> |
| 86 | <T>New thread</T> |
| 87 | </Text> |
| 88 | </Pressable> |
| 89 | ) |
| 90 | ) : null} |
| 91 | </View> |
| 92 | )} |
| 93 | </View> |
| 94 | </ScreenContent> |
| 95 | ); |
| 96 | } |