import type {RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import ListLink from 'sentry/components/links/listLink'; import LoadingError from 'sentry/components/loadingError'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import NavTabs from 'sentry/components/navTabs'; import Panel from 'sentry/components/panels/panel'; import PanelBody from 'sentry/components/panels/panelBody'; import PanelHeader from 'sentry/components/panels/panelHeader'; import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle'; import {t} from 'sentry/locale'; import type {InternetProtocol} from 'sentry/types'; import {useApiQuery} from 'sentry/utils/queryClient'; import recreateRoute from 'sentry/utils/recreateRoute'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; import SessionRow from './sessionRow'; import {tableLayout} from './utils'; type Props = RouteComponentProps<{}, {}>; type IpListType = Array | null; function SessionHistory({routes, params, location}: Props) { const { data: ipList, isLoading, isError, } = useApiQuery(['/users/me/ips/'], {staleTime: 0}); if (isError) { return ; } if (isLoading) { return ; } if (!ipList) { return null; } const recreateRouteProps = {routes, params, location}; return ( {t('Settings')} {t('Session History')} } />
{t('Sessions')}
{t('First Seen')}
{t('Last Seen')}
{ipList.map(({id, ...ipObj}) => ( ))}
); } export default SessionHistory; const SessionPanelHeader = styled(PanelHeader)` ${tableLayout} justify-content: initial; `;