2024-08-16 01:23:55 +07:00
|
|
|
import { Bucket } from "../types";
|
|
|
|
import { ArchiveIcon, ChartPie, ChartScatter } from "lucide-react";
|
|
|
|
import { readableBytes } from "@/lib/utils";
|
|
|
|
import Button from "@/components/ui/button";
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
data: Bucket;
|
|
|
|
};
|
|
|
|
|
|
|
|
const BucketCard = ({ data }: Props) => {
|
|
|
|
return (
|
|
|
|
<div className="card card-body p-6">
|
2024-08-17 00:51:57 +07:00
|
|
|
<div className="grid grid-cols-2 items-start gap-4 p-2 pb-0">
|
|
|
|
<div className="flex flex-row items-start gap-x-3 col-span-2">
|
2024-08-16 23:10:19 +07:00
|
|
|
<ArchiveIcon size={28} className="shrink-0" />
|
2024-08-16 01:23:55 +07:00
|
|
|
|
2024-08-16 23:10:19 +07:00
|
|
|
<p className="text-xl font-medium truncate">
|
2024-08-16 01:23:55 +07:00
|
|
|
{data.globalAliases?.join(", ")}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2024-08-16 23:10:19 +07:00
|
|
|
<div>
|
2024-08-16 01:23:55 +07:00
|
|
|
<p className="text-sm flex items-center gap-1">
|
|
|
|
<ChartPie className="inline" size={16} />
|
|
|
|
Usage
|
|
|
|
</p>
|
2024-08-16 23:10:19 +07:00
|
|
|
<p className="text-xl font-medium mt-1">
|
|
|
|
{readableBytes(data.bytes)}
|
|
|
|
</p>
|
2024-08-16 01:23:55 +07:00
|
|
|
</div>
|
|
|
|
|
2024-08-16 23:10:19 +07:00
|
|
|
<div>
|
2024-08-16 01:23:55 +07:00
|
|
|
<p className="text-sm flex items-center gap-1">
|
|
|
|
<ChartScatter className="inline" size={16} />
|
|
|
|
Objects
|
|
|
|
</p>
|
2024-08-16 23:10:19 +07:00
|
|
|
<p className="text-xl font-medium mt-1">{data.objects}</p>
|
2024-08-16 01:23:55 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-08-17 00:51:57 +07:00
|
|
|
<div className="flex flex-row justify-end gap-4">
|
2024-08-16 01:23:55 +07:00
|
|
|
<Button href={`/buckets/${data.id}`}>Manage</Button>
|
|
|
|
{/* <Button color="primary">Browse</Button> */}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BucketCard;
|