12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import styled from '@emotion/styled';
- import PanelItem from 'sentry/components/panels/panelItem';
- import TimeSince from 'sentry/components/timeSince';
- import {space} from 'sentry/styles/space';
- import type {InternetProtocol} from 'sentry/types/user';
- import {tableLayout} from './utils';
- function SessionRow({
- ipAddress,
- lastSeen,
- firstSeen,
- countryCode,
- regionCode,
- }: Omit<InternetProtocol, 'id'>) {
- return (
- <SessionPanelItem>
- <IpAndLocation>
- <IpAddress>{ipAddress}</IpAddress>
- {countryCode && regionCode && (
- <CountryCode>{`${countryCode} (${regionCode})`}</CountryCode>
- )}
- </IpAndLocation>
- <div>
- <StyledTimeSince date={firstSeen} />
- </div>
- <div>
- <StyledTimeSince date={lastSeen} />
- </div>
- </SessionPanelItem>
- );
- }
- export default SessionRow;
- const IpAddress = styled('div')`
- margin-bottom: ${space(0.5)};
- font-weight: ${p => p.theme.fontWeightBold};
- `;
- const CountryCode = styled('div')`
- font-size: ${p => p.theme.fontSizeRelativeSmall};
- `;
- const StyledTimeSince = styled(TimeSince)`
- font-size: ${p => p.theme.fontSizeRelativeSmall};
- `;
- const IpAndLocation = styled('div')`
- flex: 1;
- `;
- const SessionPanelItem = styled(PanelItem)`
- ${tableLayout};
- `;
|