Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
import { DataColumn, DataTable, type DataTableProps } from '@umami/react-zen';
import type { ReactNode } from 'react';
import { SortableLabel } from '@/components/common/SortableLabel';
import { useMessages } from '@/components/hooks';
import { ROLES } from '@/lib/constants';
export interface TeamsTableProps extends DataTableProps {
renderLink?: (row: any) => ReactNode;
}
export function TeamsTable({ renderLink, ...props }: TeamsTableProps) {
const { t, labels } = useMessages();
return (
<DataTable {...props}>
<DataColumn id="name" label={<SortableLabel label={t(labels.name)} sortKey="name" />}>
{renderLink}
</DataColumn>
<DataColumn id="owner" label={t(labels.owner)}>
{(row: any) => row?.members?.find(({ role }) => role === ROLES.teamOwner)?.user?.username}
</DataColumn>
<DataColumn id="members" label={t(labels.members)} align="end">
{(row: any) => row?._count?.members}
</DataColumn>
<DataColumn id="websites" label={t(labels.websites)} align="end">
{(row: any) => row?._count?.websites}
</DataColumn>
</DataTable>
);
}