/** * Queue sheet (docs/design-doc.md §4.5): ordered follow-ups with Remove and * "Edit & resend" (remove + restore text to the composer — labeled exactly * what it does). Order and membership are server-confirmed; mutations show a * pending state until the next queue_update. */ import type { BottomSheetModal } from "@gorhom/bottom-sheet"; import { forwardRef } from "react"; import { StyleSheet, View } from "react-native"; import type { QueueItem } from "../../lib/letta/model"; import { haptic } from "../../lib/haptics"; import { useTheme } from "../../theme/ThemeProvider"; import { space } from "../../theme/tokens"; import { Sheet } from "../ui/Sheet"; import { Text } from "../ui/Text"; import { Touchable } from "../ui/Touchable"; interface Props { queue: QueueItem[]; onRemove: (id: string) => void; onEditResend: (item: QueueItem) => void; } export const QueueSheet = forwardRef(function QueueSheet( { queue, onRemove, onEditResend }, ref, ) { const { colors } = useTheme(); return ( {queue.length === 0 ? ( Nothing queued. ) : ( queue.map((item, index) => ( {index + 1} {item.text} {item.pendingRemoval ? ( Removing… ) : ( { haptic.queue(); onEditResend(item); }} style={styles.action} > Edit & resend { haptic.queue(); onRemove(item.id); }} style={styles.action} > Remove )} )) )} ); }); const styles = StyleSheet.create({ item: { borderBottomWidth: StyleSheet.hairlineWidth, paddingVertical: space.sm, gap: 4 }, itemHead: { flexDirection: "row", gap: space.sm, alignItems: "flex-start" }, itemText: { flex: 1 }, actions: { flexDirection: "row", gap: space.lg, paddingLeft: space.lg }, action: { minHeight: 32 }, });