Update SessionsTable.tsx

This commit is contained in:
Minseo Lee 2024-09-09 15:07:25 +09:00
parent aec232eb6e
commit 9697ac61d3

View file

@ -5,6 +5,7 @@ import Avatar from 'components/common/Avatar';
import styles from './SessionsTable.module.css'; import styles from './SessionsTable.module.css';
import TypeIcon from 'components/common/TypeIcon'; import TypeIcon from 'components/common/TypeIcon';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import { formatLongNumberOptions } from 'lib/format';
export function SessionsTable({ data = [] }: { data: any[]; showDomain?: boolean }) { export function SessionsTable({ data = [] }: { data: any[]; showDomain?: boolean }) {
const intl = useIntl(); const intl = useIntl();
@ -21,8 +22,20 @@ export function SessionsTable({ data = [] }: { data: any[]; showDomain?: boolean
</Link> </Link>
)} )}
</GridColumn> </GridColumn>
<GridColumn name="visits" label={formatMessage(labels.visits)} width="100px" /> <GridColumn name="visits" label={formatMessage(labels.visits)} width="100px">
<GridColumn name="views" label={formatMessage(labels.views)} width="100px" /> {row => (
<span title={intl.formatNumber(row.visits)}>
{intl.formatNumber(row.visits, formatLongNumberOptions(row.visits))}
</span>
)}
</GridColumn>
<GridColumn name="views" label={formatMessage(labels.views)} width="100px">
{row => (
<span title={intl.formatNumber(row.views)}>
{intl.formatNumber(row.views, formatLongNumberOptions(row.views))}
</span>
)}
</GridColumn>
<GridColumn name="country" label={formatMessage(labels.country)}> <GridColumn name="country" label={formatMessage(labels.country)}>
{row => ( {row => (
<TypeIcon type="country" value={row.country}> <TypeIcon type="country" value={row.country}>