no size display
This commit is contained in:
@@ -18,15 +18,6 @@ const TABS = [
|
||||
{ id: 'events', label: 'Event log', icon: FiList },
|
||||
];
|
||||
|
||||
const formatBytes = (n) => {
|
||||
n = Number(n || 0);
|
||||
if (n <= 0) return '0 B';
|
||||
const u = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
let i = 0;
|
||||
while (n >= 1024 && i < u.length - 1) { n /= 1024; i++; }
|
||||
return `${n.toFixed(n >= 10 || i === 0 ? 0 : 1)} ${u[i]}`;
|
||||
};
|
||||
|
||||
const currentYm = () => {
|
||||
const d = new Date();
|
||||
return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, '0')}`;
|
||||
@@ -353,9 +344,8 @@ const VolumeView = ({ volume, domain, ymFilter }) => {
|
||||
<div className="text-xs uppercase tracking-wide text-primary-700 font-semibold">
|
||||
{domain} · {monthLabel}
|
||||
</div>
|
||||
<div className="mt-2 grid grid-cols-2 sm:grid-cols-4 gap-4">
|
||||
<div className="mt-2 grid grid-cols-1 sm:grid-cols-3 gap-4">
|
||||
<Stat label="Sent" value={volume.send_count.toLocaleString()} icon={FiSend} />
|
||||
<Stat label="Total size" value={formatBytes(volume.bytes_total)} icon={null} />
|
||||
<Stat
|
||||
label="Bounces"
|
||||
value={volume.bounce_count.toLocaleString()}
|
||||
@@ -383,7 +373,6 @@ const VolumeView = ({ volume, domain, ymFilter }) => {
|
||||
<tr className="text-left text-xs uppercase tracking-wide text-gray-500 border-b border-gray-200">
|
||||
<th className="py-2 pr-4 font-semibold">Mailbox</th>
|
||||
<th className="py-2 pr-4 font-semibold text-right">Sent</th>
|
||||
<th className="py-2 pr-4 font-semibold text-right">Size</th>
|
||||
<th className="py-2 pr-4 font-semibold text-right">Bounces</th>
|
||||
<th className="py-2 pr-4 font-semibold text-right">Complaints</th>
|
||||
</tr>
|
||||
@@ -403,7 +392,6 @@ const VolumeView = ({ volume, domain, ymFilter }) => {
|
||||
</div>
|
||||
</td>
|
||||
<td className="py-2 pr-4 text-right font-mono">{v.send_count.toLocaleString()}</td>
|
||||
<td className="py-2 pr-4 text-right font-mono text-gray-600">{formatBytes(v.bytes_total)}</td>
|
||||
<td className={`py-2 pr-4 text-right font-mono ${v.bounce_count > 0 ? 'text-amber-700' : 'text-gray-400'}`}>
|
||||
{v.bounce_count.toLocaleString()}
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user