OfflineSymbol.tsx
1 import React from 'react'; 2 3 import wifiOn from 'assets/images/wifi-on.svg'; 4 import wifiOff from 'assets/images/wifi-off.svg'; 5 6 type sizeType = 'small' | 'medium' | 'large'; 7 8 interface OfflineSymbolProps { 9 offline: boolean; 10 size?: sizeType; 11 } 12 13 const OfflineSymbol = ({ offline, size }: OfflineSymbolProps) => { 14 let width = 30; 15 let height = 12; 16 17 switch (size) { 18 case 'medium': 19 width = width * 3; 20 height = height * 3; 21 break; 22 case 'large': 23 width = width * 4; 24 height = height * 4; 25 break; 26 default: 27 break; 28 } 29 30 return <img src={offline ? wifiOff : wifiOn} alt="wifi status" width={width} height={height} />; 31 }; 32 33 export default OfflineSymbol;