import React from 'react';

import { useLocation } from 'react-router-dom';
import { Row, Box, Text, Icon, Button } from '@tlon/indigo-react';
import ReconnectButton from './ReconnectButton';
import { StatusBarItem } from './StatusBarItem';
import { Sigil } from '~/logic/lib/sigil';



const StatusBar = (props) => {

  const metaKey = (window.navigator.platform.includes('Mac')) ? '⌘' : 'Ctrl+';

  return (
    <Box
      display='grid'
      width="100%"
      gridTemplateRows="30px"
      gridTemplateColumns="3fr 1fr"
      py='3'
      px='3'
      pb='3'
      >
      <Row collapse>
      <Button borderColor='washedGray' mr='2' px='2' onClick={() => props.history.push('/')} {...props}>
        <Icon icon='Spaces' color='black'/>
      </Button>

        <StatusBarItem mr={2} onClick={() => props.api.local.setOmnibox()}>
        { !props.doNotDisturb && props.notificationsCount > 0 &&
          (<Box display="block" right="-8px" top="-8px" position="absolute" >
            <Icon color="blue" icon="Bullet" />
           </Box>
        )}
        <Icon icon='LeapArrow'/>
          <Text ml={2} color='black'>
            Leap
          </Text>
          <Text display={['none', 'inline']} ml={2} color='gray'>
            {metaKey}/
          </Text>
        </StatusBarItem>
        <ReconnectButton
          connection={props.connection}
          subscription={props.subscription}
        />
      </Row>
      <Row justifyContent="flex-end" collapse>
      {!props.doNotDisturb && (<StatusBarItem color="blue" px='12px' mr='2' onClick={() => props.history.push('/~notifications')}>
        <Text
        fontWeight={props.notificationsCount > 0 ? "500" : "400"}
        fontSize='0'
        color="blue"
        >
          {(props.notificationsCount > 99) ? "99+" : props.notificationsCount}
        </Text>
      </StatusBarItem>)}
        <StatusBarItem px={'2'} flexShrink='0' onClick={() => props.history.push('/~profile')}>
          <Sigil ship={props.ship} size={16} color='black' classes='mix-blend-diff' icon />
          <Text ml={2} display={["none", "inline"]} fontFamily="mono">~{props.ship}</Text>
        </StatusBarItem>
      </Row>
    </Box>
  );
};

export default StatusBar;

@@ -1470,391 +1470,8 @@
 se%3E%0A
-      %7B!props.doNotDisturb && (%3CStatusBarItem color=%22blue%22 px='12px' mr='2' onClick=%7B() =%3E props.history.push('/~notifications')%7D%3E%0A        %3CText%0A        fontWeight=%7Bprops.notificationsCount %3E 0 ? %22500%22 : %22400%22%7D%0A        fontSize='0'%0A        color=%22blue%22%0A        %3E%0A          %7B(props.notificationsCount %3E 99) ? %2299+%22 : props.notificationsCount%7D%0A        %3C/Text%3E%0A      %3C/StatusBarItem%3E)%7D%0A
     

remove notifs in status bar