Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/components/audio-stream/audio-stream-bottom-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
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();

Expand Down Expand Up @@ -84,9 +85,11 @@
});

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 = () => {
Expand Down Expand Up @@ -242,3 +245,4 @@
</Actionsheet>
);
};

Check warning on line 248 in src/components/audio-stream/audio-stream-bottom-sheet.tsx

View workflow job for this annotation

GitHub Actions / test

Delete `⏎`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Resolve the lint warning about the trailing newline.

Static analysis flags a stray newline at EOF; please run the formatter or remove the extra line.

🧰 Tools
🪛 GitHub Check: test

[warning] 248-248:
Delete

🤖 Prompt for AI Agents
In `@src/components/audio-stream/audio-stream-bottom-sheet.tsx` at line 248,
Remove the stray trailing newline at the end of the
audio-stream-bottom-sheet.tsx file (the AudioStreamBottomSheet component file)
to satisfy lint/formatter; either delete the extra blank line at EOF or run the
project's formatter (e.g., prettier/clang-format) to normalize file endings so
there is a single newline at EOF per project settings.

3 changes: 2 additions & 1 deletion src/components/livekit/livekit-bottom-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@ const styles = StyleSheet.create({
},
controls: {
flexDirection: 'row',
justifyContent: 'space-around',
justifyContent: 'space-evenly',
marginTop: 16,
width: '100%',
},
controlButton: {
alignItems: 'center',
Expand Down
11 changes: 2 additions & 9 deletions src/components/personnel/personnel-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { Text } from '../ui/text';
import { VStack } from '../ui/vstack';


Check warning on line 16 in src/components/personnel/personnel-card.tsx

View workflow job for this annotation

GitHub Actions / test

Delete `⏎⏎`

interface PersonnelCardProps {
personnel: PersonnelInfoResultData;
Expand All @@ -39,15 +39,8 @@
<HStack space="md" className="items-start">
{/* Profile Avatar */}
<Avatar size="md" style={imageError ? { backgroundColor: fallbackColor } : undefined}>
{!imageError && (
<AvatarImage
source={{ uri: avatarUrl }}
onError={() => setImageError(true)}
/>
)}
{imageError && (
<AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>
)}
{!imageError && <AvatarImage source={{ uri: avatarUrl }} onError={() => setImageError(true)} />}
{imageError && <AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>}
</Avatar>

<VStack space="xs" className="flex-1">
Expand Down
15 changes: 2 additions & 13 deletions src/components/personnel/personnel-details-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -98,15 +94,8 @@ export const PersonnelDetailsSheet: React.FC = () => {
<HStack space="md" className="flex-1 items-center">
{/* Profile Avatar */}
<Avatar size="lg" style={imageError ? { backgroundColor: fallbackColor } : undefined}>
{!imageError && (
<AvatarImage
source={{ uri: avatarUrl }}
onError={() => setImageError(true)}
/>
)}
{imageError && (
<AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>
)}
{!imageError && <AvatarImage source={{ uri: avatarUrl }} onError={() => setImageError(true)} />}
{imageError && <AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>}
</Avatar>
<Heading size="lg" className="flex-1 text-gray-800 dark:text-gray-100">
{fullName}
Expand Down
2 changes: 2 additions & 0 deletions src/stores/app/audio-stream-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@
isLoading: false,
isBuffering: false,
});

Check warning on line 192 in src/stores/app/audio-stream-store.ts

View workflow job for this annotation

GitHub Actions / test

Delete `⏎⏎`

}
},

Expand Down
14 changes: 14 additions & 0 deletions src/translations/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"buffering_stream": "جاري التخزين المؤقت للبث الصوتي...",
"close": "إغلاق",
"currently_playing": "يتم تشغيل حاليًا: {{streamName}}",
"error_loading_stream": "خطأ في تحميل البث الصوتي",
"loading": "جاري التحميل...",
"loading_stream": "جاري تحميل البث الصوتي...",
"loading_streams": "جاري تحميل البثوث الصوتية...",
Expand Down Expand Up @@ -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": "الموقع في الخلفية",
Expand Down
14 changes: 14 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down Expand Up @@ -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",
Expand Down