// components/admin/tabs/StorageTab.js import { useState } from "react"; import Link from "next/link"; import { bytesToSize } from "../../../components/utils"; import { deleteMyRepresentationsFromBlob, deleteAwaitingSubmissionsFromBlob, sendRepCompleteMessage, } from "../../../actions"; import { formatBlobDates } from "../utils/adminHelper"; export default function StorageTab({ data, repCompleteCount }) { const [showRepJson, setShowRepJson] = useState(true); const [showTmpFile, setShowTmpFile] = useState(true); const [listData, setListData] = useState(data); const toggleAll = () => { const newState = !(showRepJson || showTmpFile); setShowRepJson(newState); setShowTmpFile(newState); }; return (

Storage Account Contents

{repCompleteCount > 0 && (

Number of Orphaned Reps: {repCompleteCount}

)} {/* Toggle buttons */}
{/* Render users & containers */} {listData.map((user) => (
{user.containers.map((c) => (

{c.container} -{" "} {user.email}

{/* folders */} {c.folders.map((folder) => (

{folder.folderPath || "Root"}

{/* Buttons for TMP + Rep actions go here (same logic as before) */} {folder.hasTmpFile && ( <> )} {folder.hasRepJson && (
{" "} {folder.repComplete && ( )} {folder.repComplete && ( )}
)}
    {folder.blobs.map((blob) => (
  • {blob.name} ( {bytesToSize( blob.contentLength || blob.size )} ) {" "} {blob.lastModified && ( {/* { blob.displayDate } */} {formatBlobDates( blob )} )}
  • ))}
))}
))}
))}
); }