2024-03-12 03:41:49 +00:00
|
|
|
import { GeneralLayout } from "~/components/general-layout";
|
|
|
|
import { FileCard, FileCardList, FileTypes } from "~/components/file-card";
|
|
|
|
import { DataTable } from "~/components/data-table";
|
|
|
|
import { columns } from "./columns";
|
|
|
|
import { Input } from "~/components/ui/input";
|
|
|
|
import { Button } from "~/components/ui/button";
|
2024-03-13 17:01:23 +00:00
|
|
|
import { AddIcon } from "~/components/icons";
|
2024-03-22 11:31:31 +00:00
|
|
|
import { Authenticated } from "@refinedev/core";
|
|
|
|
import {
|
|
|
|
Dialog,
|
|
|
|
DialogContent,
|
|
|
|
DialogHeader,
|
|
|
|
DialogTitle,
|
|
|
|
DialogTrigger,
|
|
|
|
} from "~/components/ui/dialog";
|
|
|
|
import { Field } from "~/components/forms";
|
2024-03-12 03:41:49 +00:00
|
|
|
|
|
|
|
export default function FileManager() {
|
|
|
|
return (
|
2024-03-22 11:31:31 +00:00
|
|
|
<Authenticated key="dashboard" v3LegacyAuthProviderCompatible>
|
2024-03-22 12:47:50 +00:00
|
|
|
<GeneralLayout>
|
|
|
|
<Dialog>
|
2024-03-22 11:31:31 +00:00
|
|
|
<h1 className="font-bold mb-4 text-lg">File Manager</h1>
|
|
|
|
<FileCardList>
|
|
|
|
<FileCard
|
|
|
|
fileName="Backups"
|
|
|
|
size="33 files"
|
|
|
|
type={FileTypes.Folder}
|
|
|
|
createdAt="2 days ago"
|
|
|
|
/>
|
|
|
|
<FileCard
|
|
|
|
fileName="Backups"
|
|
|
|
size="33 files"
|
|
|
|
type={FileTypes.Folder}
|
|
|
|
createdAt="2 days ago"
|
|
|
|
/>
|
|
|
|
<FileCard
|
|
|
|
fileName="Backups"
|
|
|
|
size="33 files"
|
|
|
|
type={FileTypes.Folder}
|
|
|
|
createdAt="2 days ago"
|
|
|
|
/>
|
|
|
|
<FileCard
|
|
|
|
fileName="Backups"
|
|
|
|
size="33 files"
|
|
|
|
type={FileTypes.Folder}
|
|
|
|
createdAt="2 days ago"
|
|
|
|
/>
|
|
|
|
</FileCardList>
|
|
|
|
<h2 className="font-bold text-l mt-8">Files</h2>
|
|
|
|
<div className="flex items-center space-x-4 my-6 w-full">
|
|
|
|
<Input
|
|
|
|
fullWidth
|
|
|
|
leftIcon={<AddIcon />}
|
|
|
|
placeholder="Search files by name or CID"
|
|
|
|
className="border-ring font-medium w-full grow h-12 flex-1 bg-primary-2/10"
|
|
|
|
/>
|
|
|
|
<Button className="h-12 gap-x-2">
|
|
|
|
<AddIcon />
|
|
|
|
Select All
|
|
|
|
</Button>
|
|
|
|
<DialogTrigger asChild>
|
|
|
|
<Button className="h-12 gap-x-2">
|
|
|
|
<AddIcon />
|
|
|
|
Pin Content
|
|
|
|
</Button>
|
|
|
|
</DialogTrigger>
|
|
|
|
</div>
|
2024-03-22 16:13:10 +00:00
|
|
|
<DataTable
|
|
|
|
columns={columns}
|
|
|
|
resource="file"
|
|
|
|
dataProviderName="files"
|
|
|
|
/>
|
2024-03-22 12:47:50 +00:00
|
|
|
<DialogContent>
|
|
|
|
<DialogHeader>
|
|
|
|
<DialogTitle>Pin Content</DialogTitle>
|
|
|
|
</DialogHeader>
|
|
|
|
<form action="" className="w-full flex flex-col gap-y-4">
|
|
|
|
<Field
|
|
|
|
inputProps={{
|
|
|
|
name: "cids",
|
|
|
|
placeholder: "Comma separated CIDs",
|
|
|
|
}}
|
|
|
|
labelProps={{ htmlFor: "cids", children: "Content to Pin" }}
|
|
|
|
/>
|
2024-03-22 11:31:31 +00:00
|
|
|
|
2024-03-22 12:47:50 +00:00
|
|
|
<Button type="submit" className="w-full">
|
|
|
|
Pin Content
|
|
|
|
</Button>
|
|
|
|
</form>
|
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
|
|
|
</GeneralLayout>
|
2024-03-22 11:31:31 +00:00
|
|
|
</Authenticated>
|
2024-03-12 03:41:49 +00:00
|
|
|
);
|
|
|
|
}
|