-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile-row.tsx
More file actions
55 lines (50 loc) · 1.61 KB
/
file-row.tsx
File metadata and controls
55 lines (50 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { FileIcon, Folder as FolderIcon } from "lucide-react";
import Link from "next/link";
import type { files, folders } from "~/server/db/schema";
export function FileRow(props: { file: typeof files.$inferSelect }) {
const { file } = props;
return (
<li
key={file.id}
className="hover:bg-gray-750 border-b border-gray-700 px-6 py-4"
>
<div className="grid grid-cols-12 items-center gap-4">
<div className="col-span-6 flex items-center">
<a
href={file.url}
className="flex items-center text-gray-100 hover:text-blue-400"
target="_blank"
>
<FileIcon className="mr-3" size={20} />
{file.name}
</a>
</div>
<div className="col-span-3 text-gray-400">{"file"}</div>
<div className="col-span-3 text-gray-400">{file.size}</div>
</div>
</li>
);
}
export function FolderRow(props: { folder: typeof folders.$inferSelect }) {
const { folder } = props;
return (
<li
key={folder.id}
className="hover:bg-gray-750 border-b border-gray-700 px-6 py-4"
>
<div className="grid grid-cols-12 items-center gap-4">
<div className="col-span-6 flex items-center">
<Link
href={`/f/${folder.id}`}
className="flex items-center text-gray-100 hover:text-blue-400"
>
<FolderIcon className="mr-3" size={20} />
{folder.name}
</Link>
</div>
<div className="col-span-3 text-gray-400"></div>
<div className="col-span-3 text-gray-400"></div>
</div>
</li>
);
}