diff --git a/src/components/audio-stream/audio-stream-bottom-sheet.tsx b/src/components/audio-stream/audio-stream-bottom-sheet.tsx index c4295bf..2880e7e 100644 --- a/src/components/audio-stream/audio-stream-bottom-sheet.tsx +++ b/src/components/audio-stream/audio-stream-bottom-sheet.tsx @@ -4,20 +4,21 @@ import { useColorScheme } from 'nativewind'; import React, { useCallback, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; +import { Actionsheet, ActionsheetBackdrop, ActionsheetContent, ActionsheetDragIndicator, ActionsheetDragIndicatorWrapper } from '@/components/ui/actionsheet'; +import { Button, ButtonText } from '@/components/ui/button'; +import { HStack } from '@/components/ui/hstack'; +import { Select, SelectBackdrop, SelectContent, SelectDragIndicator, SelectDragIndicatorWrapper, SelectIcon, SelectInput, SelectItem, SelectPortal, SelectTrigger } from '@/components/ui/select'; import { Text } from '@/components/ui/text'; +import { VStack } from '@/components/ui/vstack'; import { useAnalytics } from '@/hooks/use-analytics'; +import { useToast } from '@/hooks/use-toast'; import { useAudioStreamStore } from '@/stores/app/audio-stream-store'; -import { Actionsheet, ActionsheetBackdrop, ActionsheetContent, ActionsheetDragIndicator, ActionsheetDragIndicatorWrapper } from '../ui/actionsheet'; -import { Button, ButtonText } from '../ui/button'; -import { HStack } from '../ui/hstack'; -import { Select, SelectBackdrop, SelectContent, SelectDragIndicator, SelectDragIndicatorWrapper, SelectIcon, SelectInput, SelectItem, SelectPortal, SelectTrigger } from '../ui/select'; -import { VStack } from '../ui/vstack'; - export const AudioStreamBottomSheet = () => { const { t } = useTranslation(); const { colorScheme } = useColorScheme(); const { trackEvent } = useAnalytics(); + const toast = useToast(); const { isBottomSheetVisible, setIsBottomSheetVisible, availableStreams, currentStream, isLoadingStreams, isPlaying, isLoading, isBuffering, fetchAvailableStreams, playStream, stopStream } = useAudioStreamStore(); @@ -84,9 +85,11 @@ export const AudioStreamBottomSheet = () => { }); console.error('Failed to handle stream selection:', error); + + toast.error(t('audio_streams.error_loading_stream')); } }, - [availableStreams, stopStream, playStream, trackEvent, currentStream] + [availableStreams, stopStream, playStream, trackEvent, currentStream, t, toast] ); const getCurrentStreamValue = () => { @@ -242,3 +245,4 @@ export const AudioStreamBottomSheet = () => { ); }; + diff --git a/src/components/livekit/livekit-bottom-sheet.tsx b/src/components/livekit/livekit-bottom-sheet.tsx index 9db7f4a..528d9ed 100644 --- a/src/components/livekit/livekit-bottom-sheet.tsx +++ b/src/components/livekit/livekit-bottom-sheet.tsx @@ -333,8 +333,9 @@ const styles = StyleSheet.create({ }, controls: { flexDirection: 'row', - justifyContent: 'space-around', + justifyContent: 'space-evenly', marginTop: 16, + width: '100%', }, controlButton: { alignItems: 'center', diff --git a/src/components/personnel/personnel-card.tsx b/src/components/personnel/personnel-card.tsx index 7e86568..9cccf5d 100644 --- a/src/components/personnel/personnel-card.tsx +++ b/src/components/personnel/personnel-card.tsx @@ -39,15 +39,8 @@ export const PersonnelCard: React.FC = ({ personnel, onPress {/* Profile Avatar */} - {!imageError && ( - setImageError(true)} - /> - )} - {imageError && ( - {initials} - )} + {!imageError && setImageError(true)} />} + {imageError && {initials}} diff --git a/src/components/personnel/personnel-details-sheet.tsx b/src/components/personnel/personnel-details-sheet.tsx index 41c617a..4ea1cee 100644 --- a/src/components/personnel/personnel-details-sheet.tsx +++ b/src/components/personnel/personnel-details-sheet.tsx @@ -19,10 +19,6 @@ import { HStack } from '../ui/hstack'; import { Text } from '../ui/text'; import { VStack } from '../ui/vstack'; - - - - export const PersonnelDetailsSheet: React.FC = () => { const { t } = useTranslation(); const { personnel, selectedPersonnelId, isDetailsOpen, closeDetails } = usePersonnelStore(); @@ -98,15 +94,8 @@ export const PersonnelDetailsSheet: React.FC = () => { {/* Profile Avatar */} - {!imageError && ( - setImageError(true)} - /> - )} - {imageError && ( - {initials} - )} + {!imageError && setImageError(true)} />} + {imageError && {initials}} {fullName} diff --git a/src/stores/app/audio-stream-store.ts b/src/stores/app/audio-stream-store.ts index 440552d..e919a56 100644 --- a/src/stores/app/audio-stream-store.ts +++ b/src/stores/app/audio-stream-store.ts @@ -189,6 +189,8 @@ export const useAudioStreamStore = create((set, get) => ({ isLoading: false, isBuffering: false, }); + + } }, diff --git a/src/translations/ar.json b/src/translations/ar.json index b89a55f..87334a0 100644 --- a/src/translations/ar.json +++ b/src/translations/ar.json @@ -7,6 +7,7 @@ "buffering_stream": "جاري التخزين المؤقت للبث الصوتي...", "close": "إغلاق", "currently_playing": "يتم تشغيل حاليًا: {{streamName}}", + "error_loading_stream": "خطأ في تحميل البث الصوتي", "loading": "جاري التحميل...", "loading_stream": "جاري تحميل البث الصوتي...", "loading_streams": "جاري تحميل البثوث الصوتية...", @@ -764,6 +765,19 @@ "app_info": "معلومات التطبيق", "app_name": "اسم التطبيق", "arabic": "عربي", + "audio_device_selection": { + "bluetooth_device": "جهاز بلوتوث", + "current_selection": "الاختيار الحالي", + "microphone": "الميكروفون", + "no_microphones_available": "لا توجد ميكروفونات متاحة", + "no_speakers_available": "لا توجد مكبرات صوت متاحة", + "none_selected": "لم يتم اختيار أي شيء", + "speaker": "مكبر الصوت", + "speaker_device": "مكبر الصوت", + "title": "اختيار جهاز الصوت", + "unavailable": "غير متاح", + "wired_device": "جهاز سلكي" + }, "background_geolocation": "تحديد الموقع الجغرافي في الخلفية", "background_geolocation_warning": "تسمح هذه الميزة للتطبيق بتتبع موقعك في الخلفية. تساعد في تنسيق الاستجابة للطوارئ ولكن قد تؤثر على عمر البطارية.", "background_location": "الموقع في الخلفية", diff --git a/src/translations/en.json b/src/translations/en.json index a1d498a..c3d50ae 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -7,6 +7,7 @@ "buffering_stream": "Buffering audio stream...", "close": "Close", "currently_playing": "Currently playing: {{streamName}}", + "error_loading_stream": "Failed to load audio stream", "loading": "Loading", "loading_stream": "Loading audio stream...", "loading_streams": "Loading audio streams...", @@ -764,6 +765,19 @@ "app_info": "App Info", "app_name": "App Name", "arabic": "Arabic", + "audio_device_selection": { + "bluetooth_device": "Bluetooth Device", + "current_selection": "Current Selection", + "microphone": "Microphone", + "no_microphones_available": "No microphones available", + "no_speakers_available": "No speakers available", + "none_selected": "None Selected", + "speaker": "Speaker", + "speaker_device": "Speaker", + "title": "Audio Device Selection", + "unavailable": "Unavailable", + "wired_device": "Wired Device" + }, "background_geolocation": "Background Geolocation", "background_geolocation_warning": "This feature allows the app to track your location in the background. It helps with emergency response coordination but may impact battery life.", "background_location": "Background Location", diff --git a/src/translations/es.json b/src/translations/es.json index 4fa70a2..8ff6ee0 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -7,6 +7,7 @@ "buffering_stream": "Almacenando transmisión de audio en búfer...", "close": "Cerrar", "currently_playing": "Reproduciendo actualmente: {{streamName}}", + "error_loading_stream": "Error al cargar la transmisión", "loading": "Cargando", "loading_stream": "Cargando transmisión de audio...", "loading_streams": "Cargando transmisiones de audio...", @@ -764,6 +765,19 @@ "app_info": "Información de la aplicación", "app_name": "Nombre de la aplicación", "arabic": "Árabe", + "audio_device_selection": { + "bluetooth_device": "Dispositivo Bluetooth", + "current_selection": "Selección Actual", + "microphone": "Micrófono", + "no_microphones_available": "No hay micrófonos disponibles", + "no_speakers_available": "No hay altavoces disponibles", + "none_selected": "Ninguno Seleccionado", + "speaker": "Altavoz", + "speaker_device": "Altavoz", + "title": "Selección de Dispositivo de Audio", + "unavailable": "No disponible", + "wired_device": "Dispositivo Cableado" + }, "background_geolocation": "Geolocalización en segundo plano", "background_geolocation_warning": "Esta función permite que la aplicación rastree tu ubicación en segundo plano. Ayuda con la coordinación de respuesta de emergencia pero puede impactar la duración de la batería.", "background_location": "Ubicación en segundo plano",