Files
calendar/packages/features/insights/components/TotalBookingUsersTable.tsx
T
cfa720a523 /insights (#6511)
* init page

* init insights frontend

* nit

* nit

* nit

* merge

* fixed icons

* i18n, needs features

* Init insights trpc

* Using trpc on client

* Added events timeline

* Seed analytics script

* connect ui with trpc

* Added and fixed event time lines

* WIP popular days and avg time duration event type

* added new metric graphs

* improved upgrade tip

* always show upgrade screen

* upgrade tremor.so and select inputs for page

* Remove log

* Move everything to components and add context

* Fix select types using calcom ui one

* Adding translations

* Add missing translations

* Add more translations

* min fix

* Fixes for date select

* Prefer early return and mobile design fixes

* Fix style for mobile

* Fix data with userId filter from popular events

* add user id to average time duration

* Removed submodules

* Delete website

* Update yarn.lock

* Code organization and type fixes

* trpc fixes

* Builds are now passing

* Relocates server code

* Cleanup

* Medium size screen fixes

* Added TODO

---------

Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: zomars <zomars@me.com>
2023-03-23 22:10:01 +00:00

50 lines
1.4 KiB
TypeScript

import { Table, TableBody, TableCell, TableRow, Text } from "@tremor/react";
import type { User } from "@calcom/prisma/client";
import { Avatar } from "@calcom/ui";
export const TotalBookingUsersTable = ({
data,
}: {
data:
| { userId: number | null; user: User; emailMd5?: string; count: number; Username?: string }[]
| undefined;
}) => {
return (
<Table>
<TableBody>
<>
{data && data?.length > 0 ? (
data?.map((item) => (
<TableRow key={item.userId}>
<TableCell className="flex flex-row">
<Avatar
alt={item.user.name || ""}
size="sm"
imageSrc={item.user.avatar}
title={item.user.name || ""}
className="m-2"
gravatarFallbackMd5={item.emailMd5}
/>
<p className="my-auto mx-0">
<strong>{item.user.name}</strong>
</p>
</TableCell>
<TableCell>
<Text>
<strong>{item.count}</strong>
</Text>
</TableCell>
</TableRow>
))
) : (
<TableRow>
<TableCell>No members found</TableCell>
</TableRow>
)}
</>
</TableBody>
</Table>
);
};