Open History to see the last commit
1import { Button } from "../../components/ui/Button";
2import {
3 codexFeedbackNotice,
4 type CodexFeedbackSubmission,
5} from "@t3tools/client-runtime/state/threads";
6import { Pressable, View } from "react-native";
7
8import { AppText as Text } from "../../components/ui/AppText";
9import { SymbolView } from "../../components/ui/AppSymbol";
10import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
11
12export function ComposerFeedback({
13 submission,
14 onDismiss,
15}: {
16 readonly submission: CodexFeedbackSubmission;
17 readonly onDismiss: () => void;
18}) {
19 const notice = codexFeedbackNotice(submission);
20 if (!notice) return null;
21 return (
22 <View className="px-4 pb-3">
23 <View className="gap-2 rounded-[20px] border-continuous bg-card p-4">
24 <View className="flex-row items-center gap-3">
25 <Text accessibilityLiveRegion="polite" className="min-w-0 flex-1 text-sm text-foreground">
26 {notice.title}
27 </Text>
28 {submission.status !== "uploading" ? (
29 <Pressable
30 accessibilityLabel="Dismiss feedback notice"
31 accessibilityRole="button"
32 hitSlop={12}
33 onPress={onDismiss}
34 className="p-1 active:opacity-60"
35 >
36 <SymbolView
37 name="xmark"
38 size={14}
39 tintColorClassName="accent-icon-muted"
40 type="monochrome"
41 />
42 </Pressable>
43 ) : null}
44 </View>
45 {notice.description ? (
46 <Text selectable className="text-xs text-foreground-muted">
47 {notice.description}
48 </Text>
49 ) : null}
50 {submission.status === "sent" ? (
51 <Button
52 label="Copy ID"
53 tone="text"
54 onPress={() =>
55 copyTextWithHaptic(submission.feedbackId, { target: "Codex feedback thread ID" })
56 }
57 />
58 ) : null}
59 </View>
60 </View>
61 );
62}