diff --git a/src/app/(main)/admin/teams/AdminTeamsDataTable.tsx b/src/app/(main)/admin/teams/AdminTeamsDataTable.tsx
new file mode 100644
index 00000000..53e18248
--- /dev/null
+++ b/src/app/(main)/admin/teams/AdminTeamsDataTable.tsx
@@ -0,0 +1,19 @@
+import { DataGrid } from '@/components/common/DataGrid';
+import { useTeamsQuery } from '@/components/hooks';
+import { AdminTeamsTable } from './AdminTeamsTable';
+import { ReactNode } from 'react';
+
+export function AdminTeamsDataTable({
+ showActions,
+}: {
+ showActions?: boolean;
+ children?: ReactNode;
+}) {
+ const queryResult = useTeamsQuery();
+
+ return (
+
+ {({ data }) => }
+
+ );
+}
diff --git a/src/app/(main)/admin/teams/AdminTeamsPage.tsx b/src/app/(main)/admin/teams/AdminTeamsPage.tsx
new file mode 100644
index 00000000..37f43c94
--- /dev/null
+++ b/src/app/(main)/admin/teams/AdminTeamsPage.tsx
@@ -0,0 +1,16 @@
+'use client';
+import { AdminTeamsDataTable } from './AdminTeamsDataTable';
+import { Column } from '@umami/react-zen';
+import { SectionHeader } from '@/components/common/SectionHeader';
+import { useMessages } from '@/components/hooks';
+
+export function AdminTeamsPage() {
+ const { formatMessage, labels } = useMessages();
+
+ return (
+
+
+
+
+ );
+}
diff --git a/src/app/(main)/admin/teams/AdminTeamsTable.tsx b/src/app/(main)/admin/teams/AdminTeamsTable.tsx
new file mode 100644
index 00000000..6582cf38
--- /dev/null
+++ b/src/app/(main)/admin/teams/AdminTeamsTable.tsx
@@ -0,0 +1,78 @@
+import { useState } from 'react';
+import { Row, Text, Icon, DataTable, DataColumn, MenuItem, Modal } from '@umami/react-zen';
+import Link from 'next/link';
+import { Trash } from '@/components/icons';
+import { useMessages } from '@/components/hooks';
+import { Edit } from '@/components/icons';
+import { MenuButton } from '@/components/input/MenuButton';
+import { DateDistance } from '@/components/common/DateDistance';
+
+export function AdminTeamsTable({
+ data = [],
+ showActions = true,
+}: {
+ data: any[];
+ showActions?: boolean;
+}) {
+ const { formatMessage, labels } = useMessages();
+ const [deleteUser, setDeleteUser] = useState(null);
+
+ return (
+ <>
+
+
+ {(row: any) => {row.name}}
+
+
+ {(row: any) => row?._count?.teamUser}
+
+
+ {(row: any) => row?._count?.website}
+
+
+ {(row: any) => (
+
+ {row?.teamUser?.[0]?.user?.username}
+
+ )}
+
+
+ {(row: any) => }
+
+ {showActions && (
+
+ {(row: any) => {
+ const { id } = row;
+
+ return (
+
+
+
+
+ );
+ }}
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app/(main)/admin/teams/[teamId]/AdminTeamPage.tsx b/src/app/(main)/admin/teams/[teamId]/AdminTeamPage.tsx
new file mode 100644
index 00000000..3edd1ed1
--- /dev/null
+++ b/src/app/(main)/admin/teams/[teamId]/AdminTeamPage.tsx
@@ -0,0 +1,10 @@
+'use client';
+import { TeamDetails } from '@/app/(main)/teams/[teamId]/settings/team/TeamDetails';
+
+export function AdminTeamPage({ teamId }: { teamId: string }) {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/(main)/admin/teams/[teamId]/page.tsx b/src/app/(main)/admin/teams/[teamId]/page.tsx
new file mode 100644
index 00000000..0dc9d538
--- /dev/null
+++ b/src/app/(main)/admin/teams/[teamId]/page.tsx
@@ -0,0 +1,17 @@
+import { AdminTeamPage } from './AdminTeamPage';
+import { TeamProvider } from '@/app/(main)/teams/[teamId]/TeamProvider';
+import { Metadata } from 'next';
+
+export default async function ({ params }: { params: Promise<{ teamId: string }> }) {
+ const { teamId } = await params;
+
+ return (
+
+
+
+ );
+}
+
+export const metadata: Metadata = {
+ title: 'Team',
+};
diff --git a/src/app/(main)/admin/teams/page.tsx b/src/app/(main)/admin/teams/page.tsx
new file mode 100644
index 00000000..fb0fd342
--- /dev/null
+++ b/src/app/(main)/admin/teams/page.tsx
@@ -0,0 +1,9 @@
+import { Metadata } from 'next';
+import { AdminTeamsPage } from './AdminTeamsPage';
+
+export default function () {
+ return ;
+}
+export const metadata: Metadata = {
+ title: 'Teams',
+};
diff --git a/src/app/(main)/admin/users/UsersDataTable.tsx b/src/app/(main)/admin/users/UsersDataTable.tsx
index d0cc5ec8..ae72cfed 100644
--- a/src/app/(main)/admin/users/UsersDataTable.tsx
+++ b/src/app/(main)/admin/users/UsersDataTable.tsx
@@ -7,7 +7,7 @@ export function UsersDataTable({ showActions }: { showActions?: boolean; childre
const queryResult = useUsersQuery();
return (
-
+
{({ data }) => }
);
diff --git a/src/app/(main)/admin/users/UsersSettingsPage.tsx b/src/app/(main)/admin/users/UsersPage.tsx
similarity index 93%
rename from src/app/(main)/admin/users/UsersSettingsPage.tsx
rename to src/app/(main)/admin/users/UsersPage.tsx
index b2e53dac..5c8a1ae3 100644
--- a/src/app/(main)/admin/users/UsersSettingsPage.tsx
+++ b/src/app/(main)/admin/users/UsersPage.tsx
@@ -5,7 +5,7 @@ import { SectionHeader } from '@/components/common/SectionHeader';
import { useMessages } from '@/components/hooks';
import { UserAddButton } from './UserAddButton';
-export function UsersSettingsPage() {
+export function UsersPage() {
const { formatMessage, labels } = useMessages();
const handleSave = () => {};
diff --git a/src/app/(main)/admin/users/UsersTable.tsx b/src/app/(main)/admin/users/UsersTable.tsx
index ffa0ec33..a78e66f2 100644
--- a/src/app/(main)/admin/users/UsersTable.tsx
+++ b/src/app/(main)/admin/users/UsersTable.tsx
@@ -1,22 +1,13 @@
import { useState } from 'react';
-import {
- Row,
- Text,
- Icon,
- DataTable,
- DataColumn,
- MenuItem,
- MenuSeparator,
- Modal,
-} from '@umami/react-zen';
+import { Row, Text, Icon, DataTable, DataColumn, MenuItem, Modal } from '@umami/react-zen';
import Link from 'next/link';
-import { formatDistance } from 'date-fns';
import { ROLES } from '@/lib/constants';
import { Trash } from '@/components/icons';
-import { useMessages, useLocale } from '@/components/hooks';
+import { useMessages } from '@/components/hooks';
import { Edit } from '@/components/icons';
import { MenuButton } from '@/components/input/MenuButton';
import { UserDeleteForm } from './UserDeleteForm';
+import { DateDistance } from '@/components/common/DateDistance';
export function UsersTable({
data = [],
@@ -26,7 +17,6 @@ export function UsersTable({
showActions?: boolean;
}) {
const { formatMessage, labels } = useMessages();
- const { dateLocale } = useLocale();
const [deleteUser, setDeleteUser] = useState(null);
return (
@@ -42,17 +32,12 @@ export function UsersTable({
)
}
-
- {(row: any) =>
- formatDistance(new Date(row.createdAt), new Date(), {
- addSuffix: true,
- locale: dateLocale,
- })
- }
-
-
+
{(row: any) => row._count.websiteUser}
+
+ {(row: any) => }
+
{showActions && (
{(row: any) => {
@@ -68,7 +53,6 @@ export function UsersTable({
{formatMessage(labels.edit)}
-