| 1 | import { SymbolView } from "../../components/AppSymbol"; |
| 2 | import { Platform, Pressable, View } from "react-native"; |
| 3 | |
| 4 | import { AppText as Text } from "../../components/AppText"; |
| 5 | import { MaterialNewThreadButton } from "../../components/MaterialNewThreadButton"; |
| 6 | import { MaterialFloatingActionButton } from "../../components/MaterialFloatingActionButton"; |
| 7 | import { EmptyState } from "../../components/EmptyState"; |
| 8 | |
| 9 | export function WorkspaceEmptyDetail(props: { |
| 10 | readonly onStartNewTask?: () => void; |
| 11 | readonly onAddConnection?: () => void; |
| 12 | }) { |
| 13 | return ( |
| 14 | <View |
| 15 | className={ |
| 16 | Platform.OS === "android" |
| 17 | ? "flex-1 items-center justify-center px-10" |
| 18 | : "flex-1 items-center justify-center bg-screen px-10" |
| 19 | } |
| 20 | > |
| 21 | {props.onAddConnection ? ( |
| 22 | <View className="w-full max-w-[430px]"> |
| 23 | <EmptyState |
| 24 | title="No environments connected" |
| 25 | detail="Add an environment to load projects and start coding sessions." |
| 26 | variant="plain" |
| 27 | action={ |
| 28 | <MaterialFloatingActionButton |
| 29 | label="Add environment" |
| 30 | icon="plus" |
| 31 | variant="extended" |
| 32 | tone="primary" |
| 33 | onPress={props.onAddConnection} |
| 34 | /> |
| 35 | } |
| 36 | /> |
| 37 | </View> |
| 38 | ) : ( |
| 39 | <View className="max-w-[360px] items-center gap-3"> |
| 40 | <SymbolView |
| 41 | name="sidebar.left" |
| 42 | size={34} |
| 43 | tintColorClassName="accent-icon-subtle" |
| 44 | type="hierarchical" |
| 45 | /> |
| 46 | <Text className="text-center text-xl font-t3-bold">Select a thread</Text> |
| 47 | <Text className="text-center text-base text-foreground-muted"> |
| 48 | {Platform.OS === "android" |
| 49 | ? "Choose a thread from the sidebar or start a new thread." |
| 50 | : "Choose a thread from the sidebar or start a new task."} |
| 51 | </Text> |
| 52 | {props.onStartNewTask ? ( |
| 53 | Platform.OS === "android" ? ( |
| 54 | <MaterialNewThreadButton extended className="mt-2" onPress={props.onStartNewTask} /> |
| 55 | ) : ( |
| 56 | <Pressable |
| 57 | accessibilityRole="button" |
| 58 | className="mt-2 flex-row items-center gap-2 rounded-full bg-primary px-5 py-3 active:opacity-70" |
| 59 | onPress={props.onStartNewTask} |
| 60 | > |
| 61 | <Text className="text-base font-t3-bold text-primary-foreground">New Task</Text> |
| 62 | </Pressable> |
| 63 | ) |
| 64 | ) : null} |
| 65 | </View> |
| 66 | )} |
| 67 | </View> |
| 68 | ); |
| 69 | } |