+
+ {data.length === 0 && }
);
}
diff --git a/apps/dashboard/src/locales/en.ts b/apps/dashboard/src/locales/en.ts
index 3b56168d9c..bc0231101f 100644
--- a/apps/dashboard/src/locales/en.ts
+++ b/apps/dashboard/src/locales/en.ts
@@ -46,4 +46,10 @@ export default {
profit_loss: "Profit/Loss",
income: "Income",
},
+ folders: {
+ all: "All",
+ exports: "Exports",
+ inbox: "Inbox",
+ transactions: "Transactions",
+ },
} as const;
diff --git a/apps/dashboard/src/locales/sv.ts b/apps/dashboard/src/locales/sv.ts
index 43004db72f..4cc6d87596 100644
--- a/apps/dashboard/src/locales/sv.ts
+++ b/apps/dashboard/src/locales/sv.ts
@@ -46,4 +46,10 @@ export default {
profit_loss: "Vinst/Förlust",
income: "Inkomst",
},
+ folders: {
+ all: "Alla",
+ exports: "Exporteringar",
+ inbox: "Inbox",
+ transactions: "Transaktioner",
+ },
} as const;
diff --git a/bun.lockb b/bun.lockb
index 47e126a92d..fa35c93f6b 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/packages/supabase/src/queries/index.ts b/packages/supabase/src/queries/index.ts
index 3bb0916a9a..f14db6f6d2 100644
--- a/packages/supabase/src/queries/index.ts
+++ b/packages/supabase/src/queries/index.ts
@@ -475,10 +475,17 @@ type GetVaultParams = {
path?: string;
};
-const defaultFolders = [{ id: "inbox" }, { id: "exports" }];
-
export async function getVaultQuery(supabase: Client, params: GetVaultParams) {
const { teamId, path } = params;
+
+ const defaultFolders = path
+ ? []
+ : [
+ { name: "inbox", isFolder: true },
+ { name: "exports", isFolder: true },
+ { name: "transactions", isFolder: true },
+ ];
+
let basePath = teamId;
if (path) {
@@ -487,7 +494,18 @@ export async function getVaultQuery(supabase: Client, params: GetVaultParams) {
const { data } = await supabase.storage.from("vault").list(basePath);
+ const filteredData =
+ data
+ ?.filter((file) => file.name !== ".emptyFolderPlaceholder")
+ .map((item) => ({ ...item, isFolder: !item.id })) ?? [];
+
+ const mergedMap = new Map(
+ [...defaultFolders, ...filteredData].map((obj) => [obj.name, obj])
+ );
+
+ const mergedArray = Array.from(mergedMap.values());
+
return {
- data: data?.filter((file) => file.name !== ".emptyFolderPlaceholder"),
+ data: mergedArray,
};
}
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 74abea7187..9383874848 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -22,6 +22,7 @@
"exports": {
"./calendar": "./src/components/calendar.tsx",
"./card": "./src/components/card.tsx",
+ "./context-menu": "./src/components/context-menu.tsx",
"./alert": "./src/components/alert.tsx",
"./alert-dialog": "./src/components/alert-dialog.tsx",
"./avatar": "./src/components/avatar.tsx",
@@ -61,6 +62,7 @@
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
+ "@radix-ui/react-context-menu": "^2.1.5",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
diff --git a/packages/ui/src/components/context-menu.tsx b/packages/ui/src/components/context-menu.tsx
new file mode 100644
index 0000000000..cde5d435e2
--- /dev/null
+++ b/packages/ui/src/components/context-menu.tsx
@@ -0,0 +1,199 @@
+"use client";
+
+import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
+import { Check, ChevronRight, Circle } from "lucide-react";
+import * as React from "react";
+import { cn } from "../utils";
+
+const ContextMenu = ContextMenuPrimitive.Root;
+
+const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
+
+const ContextMenuGroup = ContextMenuPrimitive.Group;
+
+const ContextMenuPortal = ContextMenuPrimitive.Portal;
+
+const ContextMenuSub = ContextMenuPrimitive.Sub;
+
+const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
+
+const ContextMenuSubTrigger = React.forwardRef<
+ React.ElementRef
,
+ React.ComponentPropsWithoutRef & {
+ inset?: boolean;
+ }
+>(({ className, inset, children, ...props }, ref) => (
+
+ {children}
+
+
+));
+ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
+
+const ContextMenuSubContent = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+));
+ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
+
+const ContextMenuContent = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+
+
+));
+ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
+
+const ContextMenuItem = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef & {
+ inset?: boolean;
+ }
+>(({ className, inset, ...props }, ref) => (
+
+));
+ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
+
+const ContextMenuCheckboxItem = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, checked, ...props }, ref) => (
+
+
+
+
+
+
+ {children}
+
+));
+ContextMenuCheckboxItem.displayName =
+ ContextMenuPrimitive.CheckboxItem.displayName;
+
+const ContextMenuRadioItem = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+
+
+
+
+
+ {children}
+
+));
+ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
+
+const ContextMenuLabel = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef & {
+ inset?: boolean;
+ }
+>(({ className, inset, ...props }, ref) => (
+
+));
+ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
+
+const ContextMenuSeparator = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+));
+ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
+
+const ContextMenuShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes) => {
+ return (
+
+ );
+};
+ContextMenuShortcut.displayName = "ContextMenuShortcut";
+
+export {
+ ContextMenu,
+ ContextMenuTrigger,
+ ContextMenuContent,
+ ContextMenuItem,
+ ContextMenuCheckboxItem,
+ ContextMenuRadioItem,
+ ContextMenuLabel,
+ ContextMenuSeparator,
+ ContextMenuShortcut,
+ ContextMenuGroup,
+ ContextMenuPortal,
+ ContextMenuSub,
+ ContextMenuSubContent,
+ ContextMenuSubTrigger,
+ ContextMenuRadioGroup,
+};
diff --git a/packages/ui/src/components/icons.tsx b/packages/ui/src/components/icons.tsx
index 1d21a018ef..9ae61cfb95 100644
--- a/packages/ui/src/components/icons.tsx
+++ b/packages/ui/src/components/icons.tsx
@@ -2,9 +2,11 @@ import { ArchiveIcon } from "@radix-ui/react-icons";
import { Settings } from "lucide-react";
import {
MdApartment,
+ MdArrowRight,
MdBarChart,
MdBrokenImage,
MdCelebration,
+ MdCreateNewFolder,
MdDescription,
MdDesk,
MdDevices,
@@ -13,8 +15,10 @@ import {
MdExpandMore,
MdFastfood,
MdFence,
+ MdFileUpload,
MdFlightTakeoff,
- MdFolderOpen,
+ MdFolder,
+ MdFolderSpecial,
MdFolderZip,
MdHomeWork,
MdInventory2,
@@ -34,6 +38,7 @@ import {
MdPictureAsPdf,
MdRefresh,
MdSave,
+ MdSearch,
MdSensors,
MdTopic,
MdTrendingDown,
@@ -327,9 +332,14 @@ export const Icons = {
MoreHoriz: MdMoreHoriz,
Pdf: MdPictureAsPdf,
DriveFileMove: MdDriveFileMove,
- FolderOpen: MdFolderOpen,
+ FolderSpecial: MdFolderSpecial,
Topic: MdTopic,
BrokenImage: MdBrokenImage,
Description: MdDescription,
FolderZip: MdFolderZip,
+ ArrowRight: MdArrowRight,
+ Folder: MdFolder,
+ FileUpload: MdFileUpload,
+ Search: MdSearch,
+ CreateNewFolder: MdCreateNewFolder,
};