-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
172 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function Breadcrumbs({ folders }) { | ||
return folders?.map((folder) => <span key={folder}>{folder}</span>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Icons } from "@midday/ui/icons"; | ||
|
||
export function FileIcon({ mimetype, name }) { | ||
if (name === "exports") { | ||
return <Icons.DriveFileMove size={16} className="text-[#878787]" />; | ||
} | ||
|
||
if (name === "inbox") { | ||
return <Icons.FolderOpen size={16} className="text-[#878787]" />; | ||
} | ||
|
||
if (name === "transactions") { | ||
return <Icons.Topic size={16} className="text-[#878787]" />; | ||
} | ||
|
||
if (mimetype?.startsWith("image")) { | ||
return <Icons.BrokenImage size={16} className="text-[#878787]" />; | ||
} | ||
|
||
switch (mimetype) { | ||
case "application/pdf": | ||
return <Icons.Pdf size={16} className="text-[#878787]" />; | ||
case "application/zip": | ||
return <Icons.FolderZip size={16} className="text-[#878787]" />; | ||
default: | ||
return <Icons.Description size={16} className="text-[#878787]" />; | ||
} | ||
} |
25 changes: 22 additions & 3 deletions
25
apps/dashboard/src/components/tables/vault/data-table-row.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
"use client"; | ||
|
||
import { FileIcon } from "@/components/file-icon"; | ||
import { formatSize } from "@/utils/format"; | ||
import { Icons } from "@midday/ui/icons"; | ||
import { TableCell, TableRow } from "@midday/ui/table"; | ||
import { format } from "date-fns"; | ||
import { usePathname, useRouter } from "next/navigation"; | ||
|
||
export function DataTableRow({ data }) { | ||
const router = useRouter(); | ||
const pathname = usePathname(); | ||
|
||
const handleNavigate = () => router.push(`${pathname}/${data.name}`); | ||
|
||
return ( | ||
<TableRow className="h-[45px]" onClick={handleNavigate}> | ||
<TableCell>{data.name}</TableCell> | ||
<TableCell>{data.created_at}</TableCell> | ||
<TableCell>wef</TableCell> | ||
<TableCell> | ||
<div className="flex items-center space-x-2"> | ||
<FileIcon mimetype={data?.metadata?.mimetype} name={data.name} /> | ||
<span>{data.name}</span> | ||
{data?.metadata?.size && ( | ||
<span className="text-[#878787]"> | ||
{formatSize(data.metadata.size)} | ||
</span> | ||
)} | ||
</div> | ||
</TableCell> | ||
<TableCell> | ||
{data?.created_at && format(new Date(data.created_at), "MMM d, yyyy")} | ||
</TableCell> | ||
<TableCell> | ||
<Icons.MoreHoriz size={16} /> | ||
</TableCell> | ||
</TableRow> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters