Files hub frontend
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import type { ComponentChildren } from "preact";
|
||||
|
||||
import { FileIcon } from "@/components/Icons.tsx";
|
||||
import { format_bytes } from "@/src/files.ts";
|
||||
|
||||
interface FileInfoProps {
|
||||
name: string;
|
||||
size: number;
|
||||
detail?: string;
|
||||
action?: ComponentChildren;
|
||||
}
|
||||
|
||||
export default function FileInfo(props: FileInfoProps) {
|
||||
return (
|
||||
<div class="flex w-full flex-row items-center gap-4">
|
||||
<FileIcon class="h-8 w-7 flex-none text-white dark:text-gray-900" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="font-medium break-all">{props.name}</p>
|
||||
<p class="pt-1 text-sm opacity-75">
|
||||
{format_bytes(props.size)}
|
||||
{props.detail && ` · ${props.detail}`}
|
||||
</p>
|
||||
</div>
|
||||
{props.action}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user