import { View, Text, Pressable, ActivityIndicator } from "react-native"; import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { X, ArrowUp } from "lucide-react-native"; import { VolumeMeter } from "./volume-meter"; import { FOOTER_HEIGHT } from "@/contexts/footer-controls-context"; interface VoiceNoteRecordingOverlayProps { volume: number; duration: number; onCancel: () => void; onSend: () => void; isTranscribing?: boolean; } function formatDuration(seconds: number): string { const mins = Math.floor(seconds / 60); const secs = seconds % 60; return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`; } export function VoiceNoteRecordingOverlay({ volume, duration, onCancel, onSend, isTranscribing = false, }: VoiceNoteRecordingOverlayProps) { const { theme } = useUnistyles(); return ( {/* Cancel button */} {/* Center: Volume meter and timer */} {formatDuration(duration)} {/* Send button */} {isTranscribing ? ( ) : ( )} ); } const BUTTON_SIZE = 56; const VERTICAL_PADDING = (FOOTER_HEIGHT - BUTTON_SIZE) / 2; const styles = StyleSheet.create((theme) => ({ container: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingHorizontal: theme.spacing[4], paddingVertical: VERTICAL_PADDING, height: FOOTER_HEIGHT, }, cancelButton: { width: BUTTON_SIZE, height: BUTTON_SIZE, borderRadius: theme.borderRadius.full, backgroundColor: "rgba(0, 0, 0, 0.15)", alignItems: "center", justifyContent: "center", }, centerContainer: { flex: 1, flexDirection: "row", alignItems: "center", justifyContent: "center", gap: theme.spacing[4], }, timerText: { fontSize: theme.fontSize.xl, fontWeight: theme.fontWeight.semibold, fontVariant: ["tabular-nums"], }, sendButton: { width: BUTTON_SIZE, height: BUTTON_SIZE, borderRadius: theme.borderRadius.full, alignItems: "center", justifyContent: "center", }, buttonDisabled: { opacity: 0.5, }, }));