+
Team Overview
@@ -53,37 +53,24 @@ export default async function Page(props: {
-
- {/* left */}
-
- {team.billingPlan === "free" ? (
-
- ) : (
-
- )}
+
+
-
+ ) : (
+
-
-
- {/* right */}
-
-
- Changelog
-
+ )}
-
-
+
);
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/projects/TeamProjectsPage.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/projects/TeamProjectsPage.tsx
index 36d0d696d0f..29b892f5d09 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/projects/TeamProjectsPage.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/projects/TeamProjectsPage.tsx
@@ -2,7 +2,15 @@
import { LazyCreateProjectDialog } from "components/settings/ApiKeys/Create/LazyCreateAPIKeyDialog";
import { format } from "date-fns";
-import { ArrowDownNarrowWideIcon, PlusIcon, SearchIcon } from "lucide-react";
+import {
+ ArrowUpDownIcon,
+ CalendarIcon,
+ CheckIcon,
+ LetterTextIcon,
+ PlusIcon,
+ SearchIcon,
+ UsersIcon,
+} from "lucide-react";
import Link from "next/link";
import { useMemo, useState } from "react";
import type { ThirdwebClient } from "thirdweb";
@@ -12,13 +20,14 @@ import { ProjectAvatar } from "@/components/blocks/Avatars/ProjectAvatar";
import { PaginationButtons } from "@/components/pagination-buttons";
import { Button } from "@/components/ui/button";
import { CopyTextButton } from "@/components/ui/CopyTextButton";
-import { Input } from "@/components/ui/input";
import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
-} from "@/components/ui/select";
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuRadioGroup,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import { Input } from "@/components/ui/input";
import {
Table,
TableBody,
@@ -83,7 +92,7 @@ export function TeamProjectsPage(props: {
return _projectsToShow;
}, [searchTerm, sortBy, projects]);
- const pageSize = 10;
+ const pageSize = 5;
const [page, setPage] = useState(1);
const paginatedProjects = sortedProjects.slice(
(page - 1) * pageSize,
@@ -93,54 +102,73 @@ export function TeamProjectsPage(props: {
const showPagination = sortedProjects.length > pageSize;
const totalPages = Math.ceil(sortedProjects.length / pageSize);
+ const hasActiveFilters = searchTerm !== "" || sortBy !== "monthlyActiveUsers";
+
return (
-
-
-
Projects
+
+
+
+
+ Projects
+
+
+ Create and manage your projects for your team
+
+
{/* Filters + Add New */}
-
{
- setSearchTerm(v);
- setPage(1);
- }}
- value={searchTerm}
- />
-
-
{
+
+
+ {
+ setSearchTerm(e.target.value);
+ setPage(1);
+ }}
+ placeholder="Name or Client ID"
+ value={searchTerm}
+ />
+
+
+
{
setSortBy(v);
setPage(1);
}}
- value={sortBy}
- />
- setIsCreateProjectDialogOpen(true)}
- teamMembersSettingsPath={`/team/${props.team.slug}/~/settings/members`}
+ sortBy={sortBy}
/>
+
+
{/* Projects Table */}
{paginatedProjects.length === 0 ? (
searchTerm !== "" ? (
-
+
) : (
-
+
No projects created
)
) : (
-
-
+
+
@@ -242,44 +265,16 @@ export function TeamProjectsPage(props: {
);
}
-function SearchInput(props: {
- value: string;
- onValueChange: (value: string) => void;
-}) {
- return (
-
- props.onValueChange(e.target.value)}
- placeholder="Project name or Client ID"
- value={props.value}
- />
-
-
- );
-}
-
-function AddNewButton(props: {
- createProject: () => void;
- teamMembersSettingsPath: string;
-}) {
- return (
-
- );
-}
+const sortByIcon: Record> = {
+ createdAt: CalendarIcon,
+ monthlyActiveUsers: UsersIcon,
+ name: LetterTextIcon,
+};
-function SelectBy(props: {
- value: SortById;
- onChange: (value: SortById) => void;
+function SortDropdown(props: {
+ sortBy: SortById;
+ onSortChange: (value: SortById) => void;
+ hasActiveFilters: boolean;
}) {
const values: SortById[] = ["name", "createdAt", "monthlyActiveUsers"];
const valueToLabel: Record = {
@@ -289,25 +284,49 @@ function SelectBy(props: {
};
return (
-
+
+
+
+
+
+ props.onSortChange(v as SortById)}
+ value={props.sortBy}
+ >
+ {values.map((value) => {
+ const Icon = sortByIcon[value];
+ return (
+ props.onSortChange(value)}
+ >
+
+
+ {valueToLabel[value]}
+
+
+ {props.sortBy === value ? (
+
+ ) : (
+
+ )}
+
+ );
+ })}
+
+
+
);
}