Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List users and patients #14

Merged
merged 60 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e77da40
Create users page
arkadiuszbachorski Jul 11, 2024
e0c1226
Add round button
arkadiuszbachorski Jul 13, 2024
b432e4d
Add firebase admin
arkadiuszbachorski Jul 13, 2024
6751177
Implement list users
arkadiuszbachorski Jul 13, 2024
0cb356b
Add more fields to utils
arkadiuszbachorski Jul 14, 2024
fcbd3a3
Rework roles
arkadiuszbachorski Jul 14, 2024
5d5bd2c
Improve readability of User
arkadiuszbachorski Jul 14, 2024
6f2e767
Add patients view
arkadiuszbachorski Jul 14, 2024
ad829db
Add search to DataTable
arkadiuszbachorski Jul 14, 2024
78994eb
Add isHoverable prop to TableRow
arkadiuszbachorski Jul 14, 2024
32777bd
Support sorting
arkadiuszbachorski Jul 15, 2024
935486b
Create RowDropdownMenu component
arkadiuszbachorski Jul 15, 2024
47abbe9
Style icon size inside of DropdownMenuItem
arkadiuszbachorski Jul 15, 2024
b96f692
Create CopyText component
arkadiuszbachorski Jul 15, 2024
67c6c18
Use CopyText for ids
arkadiuszbachorski Jul 15, 2024
f510495
Add Toaster support
arkadiuszbachorski Jul 15, 2024
f83142c
Notify user with toast when copying
arkadiuszbachorski Jul 15, 2024
ad198ee
Add PartialSome helper
arkadiuszbachorski Jul 15, 2024
bbd5aa8
Fix TS errors
arkadiuszbachorski Jul 15, 2024
ed9cd75
Improve column actions
arkadiuszbachorski Jul 15, 2024
702f9a2
Improve states
arkadiuszbachorski Jul 15, 2024
3ec2450
Handle pagination
arkadiuszbachorski Jul 15, 2024
af0ae3e
Add additional field from patient to the table
arkadiuszbachorski Jul 15, 2024
3a6aed0
Fix lock
arkadiuszbachorski Jul 16, 2024
a8852c3
Fix clinicians collection name
arkadiuszbachorski Jul 16, 2024
b8515c7
Polish CopyText
arkadiuszbachorski Jul 16, 2024
1fc1969
Polish RangeCounter component
arkadiuszbachorski Jul 16, 2024
338d1b1
Add story for Round button
arkadiuszbachorski Jul 16, 2024
9105dea
Fix Tooltip typo
arkadiuszbachorski Jul 17, 2024
f466179
Add storybook to Pagination
arkadiuszbachorski Jul 17, 2024
e0f0844
Polish ButtonPagination component
arkadiuszbachorski Jul 17, 2024
c0b2fb1
Add Url helper to misc
arkadiuszbachorski Jul 17, 2024
48a31b2
Create LinkPagination component
arkadiuszbachorski Jul 17, 2024
b49514f
Remove ButtonPagination from index export
arkadiuszbachorski Jul 17, 2024
b75eae2
Improve DataTable component
arkadiuszbachorski Jul 17, 2024
c40211c
Add story to RowDropdownMenu component
arkadiuszbachorski Jul 17, 2024
fda3a15
Add Toaster story
arkadiuszbachorski Jul 20, 2024
68adcbd
Use sort instead of toSorted because of GitHub actions
arkadiuszbachorski Jul 20, 2024
6627090
Add missing compliance
arkadiuszbachorski Jul 20, 2024
17d14a2
Fix Next build
arkadiuszbachorski Jul 20, 2024
235984a
Fix ESLint
arkadiuszbachorski Jul 20, 2024
2497d70
Add Toaster test
arkadiuszbachorski Jul 20, 2024
95e6876
Add RowDropdownMenu test
arkadiuszbachorski Jul 20, 2024
6878fcd
Remove mocks from CopyText
arkadiuszbachorski Jul 20, 2024
18f3f60
Fix ESLint
arkadiuszbachorski Jul 20, 2024
08d9ea2
Update firebase
arkadiuszbachorski Jul 21, 2024
c4bd568
Hardcode emulators
arkadiuszbachorski Jul 21, 2024
1acccdb
Add safe checks to getUserRole
arkadiuszbachorski Jul 21, 2024
57f9bfc
Make DataTable EmptyState non hoverable
arkadiuszbachorski Jul 21, 2024
984d2ee
Replace admin calls with function calls
arkadiuszbachorski Jul 21, 2024
a301ab6
Remove admin app code
arkadiuszbachorski Jul 21, 2024
03853d0
Improve data getting
arkadiuszbachorski Jul 21, 2024
df48e75
ESLint
arkadiuszbachorski Jul 21, 2024
ae57163
Install es-toolkit
arkadiuszbachorski Jul 21, 2024
71cd483
Implement batching
arkadiuszbachorski Jul 21, 2024
60584d7
Parametrize emulation
arkadiuszbachorski Jul 21, 2024
c0d584b
Add missing compliance
arkadiuszbachorski Jul 21, 2024
df74ac0
Fix ESLint
arkadiuszbachorski Jul 21, 2024
1bb2d69
Fix types
arkadiuszbachorski Jul 21, 2024
ac66690
Improve mapUserData return type
arkadiuszbachorski Jul 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ yarn-error.log*

# local env files
.env*.local
# Firebase admin credentials
admin-creds.json

# vercel
.vercel
Expand Down
37 changes: 11 additions & 26 deletions app/(dashboard)/layout.tsx → app/(dashboard)/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,23 @@
//
// SPDX-License-Identifier: MIT
//
import { Home } from 'lucide-react'
import Link from 'next/link'
import { type ReactNode } from 'react'
import { LogoType } from '@/components/icons/LogoType'
import { getAuthenticatedOnlyApp } from '@/modules/firebase/guards'
import { getAuthenticatedOnlyApp, getUserRole } from '@/modules/firebase/guards'

Check warning on line 10 in app/(dashboard)/DashboardLayout.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/DashboardLayout.tsx#L10

Added line #L10 was not covered by tests
import { getUserInfo } from '@stanfordbdhg/design-system/modules/auth/user'
import {
DashboardLayout as DashboardLayoutBase,
MenuItem,
PageTitle,
type DashboardLayoutProps as DashboardLayoutPropsBase,
} from '@stanfordbdhg/design-system/molecules/DashboardLayout'
import { MenuLinks } from './MenuLinks'

Check warning on line 16 in app/(dashboard)/DashboardLayout.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/DashboardLayout.tsx#L16

Added line #L16 was not covered by tests
import { User } from './User'

interface DashboardLayoutProps {
children?: ReactNode
}

export const dynamic = 'force-dynamic'

const MenuLinks = () => (
<>
<MenuItem href="/" label="Home" icon={<Home />} isActive />
</>
)
interface DashboardLayoutProps
extends Pick<DashboardLayoutPropsBase, 'children' | 'title'> {}

const DashboardLayout = async ({ children }: DashboardLayoutProps) => {
export const DashboardLayout = async (props: DashboardLayoutProps) => {

Check warning on line 22 in app/(dashboard)/DashboardLayout.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/DashboardLayout.tsx#L22

Added line #L22 was not covered by tests
const { currentUser } = await getAuthenticatedOnlyApp()

const { role: userRole } = await getUserRole()

Check warning on line 24 in app/(dashboard)/DashboardLayout.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/DashboardLayout.tsx#L24

Added line #L24 was not covered by tests
const user = <User user={getUserInfo(currentUser)} />

return (
Expand All @@ -43,24 +32,20 @@
<LogoType className="!h-auto !w-full px-2 xl:px-8" />
</Link>
<nav className="mt-9 flex flex-col gap-1 xl:w-full">
<MenuLinks />
<MenuLinks role={userRole} />
</nav>
{user}
</>
}
mobile={
<>
<nav className="mt-9 flex flex-col gap-1 px-4">
<MenuLinks />
<MenuLinks role={userRole} />
</nav>
{user}
</>
}
title={<PageTitle icon={<Home />} title="Home" />}
>
{children}
</DashboardLayoutBase>
{...props}
/>
)
}

export default DashboardLayout
39 changes: 39 additions & 0 deletions app/(dashboard)/MenuLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
//
// SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//
'use client'
import { Home, Users, Contact } from 'lucide-react'
import { usePathname } from 'next/navigation'
import { Role } from '@/modules/firebase/role'
import { MenuItem } from '@stanfordbdhg/design-system/molecules/DashboardLayout'

Check warning on line 12 in app/(dashboard)/MenuLinks.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/MenuLinks.tsx#L9-L12

Added lines #L9 - L12 were not covered by tests

interface MenuLinksProps {
role: Role
}

export const MenuLinks = ({ role }: MenuLinksProps) => {
const pathname = usePathname()

Check warning on line 19 in app/(dashboard)/MenuLinks.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/MenuLinks.tsx#L18-L19

Added lines #L18 - L19 were not covered by tests

const hrefProps = (href: string) => ({

Check warning on line 21 in app/(dashboard)/MenuLinks.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/MenuLinks.tsx#L21

Added line #L21 was not covered by tests
href,
isActive: pathname === href,
})

return (

Check warning on line 26 in app/(dashboard)/MenuLinks.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/MenuLinks.tsx#L26

Added line #L26 was not covered by tests
<>
<MenuItem {...hrefProps('/')} label="Home" icon={<Home />} />
{role === Role.admin && (
<MenuItem {...hrefProps('/users')} label="Users" icon={<Users />} />

Check warning on line 30 in app/(dashboard)/MenuLinks.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/MenuLinks.tsx#L30

Added line #L30 was not covered by tests
)}
<MenuItem
{...hrefProps('/patients')}
label="Patients"
icon={<Contact />}
/>
</>
)
}
2 changes: 1 addition & 1 deletion app/(dashboard)/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const User = ({ user }: UserProps) => (
await auth.signOut()
}}
>
<LogOut className="size-4" />
<LogOut />
Sign Out
</DropdownMenuItem>
</DropdownMenuContent>
Expand Down
7 changes: 5 additions & 2 deletions app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
//
// SPDX-License-Identifier: MIT
//
import { Home } from 'lucide-react'
import { PageTitle } from '@/packages/design-system/src/molecules/DashboardLayout'
import { DashboardLayout } from './DashboardLayout'

Check warning on line 10 in app/(dashboard)/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/page.tsx#L8-L10

Added lines #L8 - L10 were not covered by tests

const DashboardPage = () => (
<div className="text-center">
<DashboardLayout title={<PageTitle title="Home" icon={<Home />} />}>

Check warning on line 13 in app/(dashboard)/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/page.tsx#L13

Added line #L13 was not covered by tests
<h1 className="text-2xl">Dashboard</h1>
</div>
</DashboardLayout>
)

export default DashboardPage
58 changes: 58 additions & 0 deletions app/(dashboard)/patients/PatientsTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
//
// SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//
'use client'
import { createColumnHelper } from '@tanstack/table-core'
import { Pencil, Trash } from 'lucide-react'
import { CopyText } from '@/packages/design-system/src/components/CopyText'
import {

Check warning on line 12 in app/(dashboard)/patients/PatientsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/PatientsTable.tsx#L9-L12

Added lines #L9 - L12 were not covered by tests
DataTable,
RowDropdownMenu,
} from '@/packages/design-system/src/components/DataTable'
import { DropdownMenuItem } from '@/packages/design-system/src/components/DropdownMenu'

Check warning on line 16 in app/(dashboard)/patients/PatientsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/PatientsTable.tsx#L16

Added line #L16 was not covered by tests
import type { Patient } from './page'

const columnHelper = createColumnHelper<Patient>()

Check warning on line 19 in app/(dashboard)/patients/PatientsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/PatientsTable.tsx#L19

Added line #L19 was not covered by tests

const columns = [

Check warning on line 21 in app/(dashboard)/patients/PatientsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/PatientsTable.tsx#L21

Added line #L21 was not covered by tests
columnHelper.accessor('uid', {
header: 'Id',
cell: (props) => (
<CopyText className="max-w-[7rem]">{props.getValue()}</CopyText>

Check warning on line 25 in app/(dashboard)/patients/PatientsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/PatientsTable.tsx#L25

Added line #L25 was not covered by tests
),
}),
columnHelper.accessor('displayName', {
header: 'Name',
cell: (props) => props.getValue() ?? '-',
}),
columnHelper.accessor('email', { header: 'Email' }),
columnHelper.accessor('gender', { header: 'Gender' }),
columnHelper.display({
id: 'actions',
cell: () => (
// TODO: Actions
<RowDropdownMenu>

Check warning on line 38 in app/(dashboard)/patients/PatientsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/PatientsTable.tsx#L38

Added line #L38 was not covered by tests
<DropdownMenuItem>
<Pencil />
Edit
</DropdownMenuItem>
<DropdownMenuItem>
<Trash />
Delete
</DropdownMenuItem>
</RowDropdownMenu>
),
}),
]

interface PatientsDataTableProps {
data: Patient[]
}

export const PatientsTable = ({ data }: PatientsDataTableProps) => (
<DataTable columns={columns} data={data} entityName="patients" />

Check warning on line 57 in app/(dashboard)/patients/PatientsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/PatientsTable.tsx#L56-L57

Added lines #L56 - L57 were not covered by tests
)
74 changes: 74 additions & 0 deletions app/(dashboard)/patients/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
//
// SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//
import { getDocs, query, where } from 'firebase/firestore'
import { Contact } from 'lucide-react'
import { getAuthenticatedOnlyApp, getUserRole } from '@/modules/firebase/guards'
import { Role } from '@/modules/firebase/role'
import { mapUserData } from '@/modules/firebase/user'
import { PageTitle } from '@/packages/design-system/src/molecules/DashboardLayout'
import { PatientsTable } from './PatientsTable'
import { DashboardLayout } from '../DashboardLayout'

Check warning on line 15 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L8-L15

Added lines #L8 - L15 were not covered by tests

const getPatientsQuery = async () => {
const { refs } = await getAuthenticatedOnlyApp()
const userRole = await getUserRole()

Check warning on line 19 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L17-L19

Added lines #L17 - L19 were not covered by tests
if (userRole.role === Role.admin) return refs.users()
if (userRole.role === Role.owner) {
const organizationIds = userRole.organizations.docs.map((doc) => doc.id)
return query(refs.users(), where('organization', 'in', organizationIds))

Check warning on line 23 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L22-L23

Added lines #L22 - L23 were not covered by tests
}
if (userRole.role === Role.clinician) {
const organizationId = userRole.clinician.data().organization

Check warning on line 26 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L26

Added line #L26 was not covered by tests
if (!organizationId) {
// TODO: Check if there is any reason for organization not to be defined
throw new Error('')

Check warning on line 29 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L29

Added line #L29 was not covered by tests
}
return query(refs.users(), where('organization', '==', organizationId))

Check warning on line 31 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L31

Added line #L31 was not covered by tests
}
// Other roles can't reach this point, so this should never execute
throw new Error()

Check warning on line 34 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L34

Added line #L34 was not covered by tests
}

const listPatients = async () => {
const patientsQuery = await getPatientsQuery()
const patients = await getDocs(patientsQuery)
const userIdsToGet = patients.docs.map((patient) => patient.id)
const patientsById = new Map(

Check warning on line 41 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L37-L41

Added lines #L37 - L41 were not covered by tests
patients.docs.map(
(patient) => [patient.id, { id: patient.id, ...patient.data() }] as const,

Check warning on line 43 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L43

Added line #L43 was not covered by tests
),
)

return mapUserData(userIdsToGet, (authData, id) => {
const patient = patientsById.get(id)

Check warning on line 48 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L47-L48

Added lines #L47 - L48 were not covered by tests
if (!patient) {
console.error(`No patient found for user id ${id}`)
return null

Check warning on line 51 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L50-L51

Added lines #L50 - L51 were not covered by tests
}
return {

Check warning on line 53 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L53

Added line #L53 was not covered by tests
uid: id,
email: authData.email,
displayName: authData.displayName,
gender: patient.GenderIdentityKey,
}
})
}

export type Patient = Awaited<ReturnType<typeof listPatients>>[number]

const PatientsPage = async () => {
const patients = await listPatients()

Check warning on line 65 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L64-L65

Added lines #L64 - L65 were not covered by tests

return (

Check warning on line 67 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L67

Added line #L67 was not covered by tests
<DashboardLayout title={<PageTitle title="Patients" icon={<Contact />} />}>
<PatientsTable data={patients} />
</DashboardLayout>
)
}

export default PatientsPage

Check warning on line 74 in app/(dashboard)/patients/page.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/patients/page.tsx#L74

Added line #L74 was not covered by tests
58 changes: 58 additions & 0 deletions app/(dashboard)/users/UsersTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
//
// SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//
'use client'
import { createColumnHelper } from '@tanstack/table-core'
import { Pencil, Trash } from 'lucide-react'
import { CopyText } from '@/packages/design-system/src/components/CopyText'
import {

Check warning on line 12 in app/(dashboard)/users/UsersTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/users/UsersTable.tsx#L9-L12

Added lines #L9 - L12 were not covered by tests
DataTable,
RowDropdownMenu,
} from '@/packages/design-system/src/components/DataTable'
import { DropdownMenuItem } from '@/packages/design-system/src/components/DropdownMenu'

Check warning on line 16 in app/(dashboard)/users/UsersTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/users/UsersTable.tsx#L16

Added line #L16 was not covered by tests
import type { User } from './page'

const columnHelper = createColumnHelper<User>()

Check warning on line 19 in app/(dashboard)/users/UsersTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/users/UsersTable.tsx#L19

Added line #L19 was not covered by tests

const columns = [

Check warning on line 21 in app/(dashboard)/users/UsersTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/users/UsersTable.tsx#L21

Added line #L21 was not covered by tests
columnHelper.accessor('uid', {
header: 'Id',
cell: (props) => (
<CopyText className="max-w-[7rem]">{props.getValue()}</CopyText>

Check warning on line 25 in app/(dashboard)/users/UsersTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/users/UsersTable.tsx#L25

Added line #L25 was not covered by tests
),
}),
columnHelper.accessor('displayName', {
header: 'Name',
cell: (props) => props.getValue() ?? '-',
}),
columnHelper.accessor('email', { header: 'Email' }),
columnHelper.accessor('role', { header: 'Role' }),
columnHelper.display({
id: 'actions',
cell: () => (
// TODO: Actions
<RowDropdownMenu>

Check warning on line 38 in app/(dashboard)/users/UsersTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/users/UsersTable.tsx#L38

Added line #L38 was not covered by tests
<DropdownMenuItem>
<Pencil />
Edit
</DropdownMenuItem>
<DropdownMenuItem>
<Trash />
Delete
</DropdownMenuItem>
</RowDropdownMenu>
),
}),
]

interface UsersDataTableProps {
data: User[]
}

export const UsersTable = ({ data }: UsersDataTableProps) => (
<DataTable columns={columns} data={data} entityName="users" />

Check warning on line 57 in app/(dashboard)/users/UsersTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/(dashboard)/users/UsersTable.tsx#L56-L57

Added lines #L56 - L57 were not covered by tests
)
Loading
Loading