1import { RequestActionButton } from "./RequestActionButton";
2import { View } from "react-native";
3
4import { AppText as Text } from "../../components/AppText";
5
6/**
7 * Shown in place of the composer when the server rejected a new task. The
8 * prompt and attachments are already back in the project draft, so the only
9 * action is reopening it.
10 */
11export function ThreadCreationFailedCard(props: {
12 readonly reason: string;
13 readonly onEditTask: () => void;
14}) {
15 return (
16 <View className="gap-2.5 rounded-[20px] border border-border-subtle bg-card-alt p-4">
17 <Text className="font-t3-bold text-2xs uppercase tracking-[1.1px] text-danger-foreground">
18 Could not start task
19 </Text>
20 <Text className="font-sans text-sm leading-normal text-foreground-secondary">
21 {props.reason}
22 </Text>
23 <Text className="font-sans text-xs leading-normal text-foreground-secondary">
24 Your prompt was kept in the project draft.
25 </Text>
26 <View className="flex-row">
27 <RequestActionButton label="Edit task" onPress={props.onEditTask} />
28 </View>
29 </View>
30 );
31}