Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

FreshSessionNotice.tsx

22 lines870 Bytes

1import { useGT } from "gt-react-native";
2import { View } from "react-native";
3​
4import { Notice } from "../../components/ui/Notice";
5import { setFreshSessionPending, useComposerDraftSettings } from "../../state/use-composer-drafts";
6​
7/** Shown while `/clear` is armed; dismissing it keeps the current session. */
8export function FreshSessionNotice(props: { readonly threadKey: string }) {
9 const gt = useGT();
10 if (useComposerDraftSettings(props.threadKey).freshContext !== true) return null;
11 return (
12 <View className="px-4 pb-3">
13 <Notice
14 message={gt`Your next message starts a fresh session. The agent won't see earlier messages in this thread.`}
15 icon="arrow.clockwise"
16 floating
17 onDismiss={() => setFreshSessionPending(props.threadKey, false)}
18 dismissLabel={gt`Keep the current session`}
19 />
20 </View>
21 );