Updated event data view.

This commit is contained in:
Mike Cao 2024-02-26 00:53:56 -08:00
parent 7723576212
commit 968fda33e3

View File

@ -1,32 +1,15 @@
import { GridTable, GridColumn, Icon, Text } from 'react-basics'; import { GridTable, GridColumn } from 'react-basics';
import { useMessages, useNavigation } from 'components/hooks'; import { useMessages } from 'components/hooks';
import Icons from 'components/icons';
import PageHeader from 'components/layout/PageHeader'; import PageHeader from 'components/layout/PageHeader';
import Empty from 'components/common/Empty'; import Empty from 'components/common/Empty';
import { DATA_TYPES } from 'lib/constants'; import { DATA_TYPES } from 'lib/constants';
import LinkButton from 'components/common/LinkButton';
export function EventDataValueTable({ data = [], event }: { data: any[]; event: string }) { export function EventDataValueTable({ data = [], event }: { data: any[]; event: string }) {
const { formatMessage, labels } = useMessages(); const { formatMessage, labels } = useMessages();
const { renderUrl } = useNavigation();
const Title = () => {
return (
<>
<LinkButton href={renderUrl({ event: undefined })}>
<Icon rotate={180}>
<Icons.ArrowRight />
</Icon>
<Text>{formatMessage(labels.back)}</Text>
</LinkButton>
<Text>{event}</Text>
</>
);
};
return ( return (
<> <>
<PageHeader title={<Title />} /> <PageHeader title={event} />
{data.length <= 0 && <Empty />} {data.length <= 0 && <Empty />}
{data.length > 0 && ( {data.length > 0 && (
<GridTable data={data}> <GridTable data={data}>