From 49f6ff04d0da06e88aad86478051c421570c49b8 Mon Sep 17 00:00:00 2001
From: Eliezer Steinbock <3090527+elie222@users.noreply.github.com>
Date: Tue, 5 Nov 2024 22:56:54 -0500
Subject: [PATCH 1/2] Add more actions to categories
---
apps/web/components/GroupedTable.tsx | 67 +++++++++++++++++++++++++---
1 file changed, 62 insertions(+), 5 deletions(-)
diff --git a/apps/web/components/GroupedTable.tsx b/apps/web/components/GroupedTable.tsx
index 239f4b517..43e8af966 100644
--- a/apps/web/components/GroupedTable.tsx
+++ b/apps/web/components/GroupedTable.tsx
@@ -12,7 +12,14 @@ import {
type ColumnDef,
flexRender,
} from "@tanstack/react-table";
-import { ArchiveIcon, ChevronRight, PencilIcon } from "lucide-react";
+import {
+ ArchiveIcon,
+ ChevronRight,
+ MoreVerticalIcon,
+ PencilIcon,
+ TagIcon,
+ TagsIcon,
+} from "lucide-react";
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
import type { Category } from "@prisma/client";
import { EmailCell } from "@/components/EmailCell";
@@ -41,6 +48,17 @@ import {
import { getGmailSearchUrl, getGmailUrl } from "@/utils/url";
import { MessageText } from "@/components/Typography";
import { CreateCategoryDialog } from "@/app/(app)/smart-categories/CreateCategoryButton";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuPortal,
+ DropdownMenuSub,
+ DropdownMenuSubTrigger,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import { useLabels, type UserLabel } from "@/hooks/useLabels";
+import { LabelsSubMenu } from "@/components/LabelsSubMenu";
const COLUMNS = 4;
@@ -172,6 +190,8 @@ export function GroupedTable({
const [selectedCategoryName, setSelectedCategoryName] =
useQueryState("categoryName");
+ const { userLabels: labels } = useLabels();
+
return (
<>
@@ -204,6 +224,7 @@ export function GroupedTable({
}}
onArchiveAll={onArchiveAll}
onEditCategory={onEditCategory}
+ labels={labels}
/>
{isCategoryExpanded && (
void;
onArchiveAll: () => void;
onEditCategory: () => void;
@@ -346,10 +369,44 @@ function GroupRow({
-
+
+
+
+
+
+
+
+ Edit Prompt
+
+
+
+ Auto archive
+
+
+
+
+
+ Auto archive and label
+
+
+ {}} />
+
+
+
+
+
+
+ Auto label
+
+
+ {}} />
+
+
+
+