import React from 'react'; import { Label } from '@widergy/mobile-ui'; import { TouchableOpacity, View } from 'react-native'; import styles from './styles'; import { useBluetoothContext } from '../../bluetooth/useBluetoothContext'; import NotificationDot from './components/NotificationDot'; import Badge from '../Badge'; import Colors from '../Colors'; interface Translations { title: string; version: Function; firmwareLoading: string; availableUpgrade: string; unavailableFirwareVersion: string; lastUpdatedAt: Function; retry: string; } interface Style { badge: { label: object; background: object }; } interface Props { translations: Translations; firmwareUpgrade: boolean; goToFirmwareInstallation: () => {}; updateAvailable: boolean; showLoadingBadge: boolean; mayRetry: boolean; firmwareTimestamp: boolean; style?: Style; } const ProbeFirmware = ({ translations, firmwareUpgrade, goToFirmwareInstallation, updateAvailable, showLoadingBadge, mayRetry, firmwareTimestamp, style, }: Props) => { const bluetoothContext = useBluetoothContext(); const isTouchable = updateAvailable || mayRetry; return ( {updateAvailable && } {showLoadingBadge && ( )} {updateAvailable && ( )} {!bluetoothContext.version && ( )} {!!firmwareUpgrade && ( )} {!!mayRetry && ( )} ); }; export default ProbeFirmware;