import { DriveLogEntry, isCreateFileEntry, isRenameEntry } from "@/lib/drive_types" import { DriveHeader } from "@/components/drive/DriveHeader" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Button } from "@/components/ui/button" import { ChevronLeft, ChevronRight } from "lucide-react" import { formatFileSize } from "@/lib/utils" import Link from "next/link" interface HistoryViewProps { entries: DriveLogEntry[] currentPage: number hasNextPage: boolean hasPrevPage: boolean totalEntries: number } function formatDateTime(timestamp: number): string { return new Date(timestamp * 1000).toLocaleString() } function PaginationControls({ currentPage, hasNextPage, hasPrevPage }: { currentPage: number hasNextPage: boolean hasPrevPage: boolean }) { return (
Page {currentPage + 1}
) } export function HistoryView({ entries, currentPage, hasNextPage, hasPrevPage, totalEntries }: HistoryViewProps) { return (

Activity History

Showing {entries.length} of {totalEntries} entries
Timestamp Action User Path Size {entries.length === 0 ? ( No activity history found ) : ( entries.map((entry) => ( {formatDateTime(entry.timestamp)} {entry.action} {entry.email} {isCreateFileEntry(entry) ? ( {entry.path} ) : isRenameEntry(entry) ? ( {entry.old_path} → {entry.new_path} ) : ( {'path' in entry ? entry.path : ''} )} {isCreateFileEntry(entry) ? formatFileSize(entry.size) : '-'} )) )}
) }