import React from 'react'; import { Text, TouchableOpacity, ActivityIndicator } from 'react-native'; import { useAppTheme } from '@theme'; import { getStyles } from './onlineToggleButton.styles'; interface OnlineToggleButtonProps { isOnline: boolean; onToggle: () => void; isLoading?: boolean; } export const OnlineToggleButton: React.FC = ({ isOnline, onToggle, isLoading = false, }) => { const { colors } = useAppTheme(); const styles = getStyles(colors); const buttonStyle = isOnline ? styles.offlineBg : styles.onlineBg; const label = isOnline ? 'Go Offline' : 'Go Online'; return ( {isLoading ? ( ) : ( {label} )} ); }; export default OnlineToggleButton;