Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions laprogram/app/admin/components/ReportTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ function CopyButton({ text, disabled }: { text: string; disabled?: boolean }) {
);
}

function formatUidLines(uids: UidInformation[]) {
return uids.map((u) => `${u.uid}\t${u.name}\t${u.email}`).join("\n");
}

function downloadExcel(
course: string,
uids: UidInformation[],
Expand Down Expand Up @@ -153,7 +157,7 @@ function UidLists() {
{entry[type].length}
</span>
<CopyButton
text={entry[type].join("\n")}
text={formatUidLines(entry[type])}
disabled={entry[type].length === 0}
/>
<button
Expand All @@ -171,9 +175,7 @@ function UidLists() {
</div>
<pre className="max-h-64 overflow-auto rounded-md border bg-muted/30 p-2 font-mono text-xs">
{entry[type].length > 0
? entry[type]
.map((u) => `${u.uid}\t${u.name}\t${u.email}`)
.join("\n")
? formatUidLines(entry[type])
: "—"}
</pre>
</div>
Expand Down