mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-05 05:31:31 +02:00
Fix conflict
This commit is contained in:
@@ -575,7 +575,6 @@ function SortableQueueItem({
|
||||
</div>
|
||||
|
||||
{/* Status badge + Actions */}
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<div className="flex flex-col sm:flex-row items-end sm:items-center gap-2 sm:gap-1 shrink-0" onClick={(e) => e.stopPropagation()}>
|
||||
<StatusBadge status={item.status} waitingReason={item.waiting_reason} printerState={printerState} t={t} />
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ export function formatETA(
|
||||
): string {
|
||||
const now = new Date();
|
||||
const eta = new Date(now.getTime() + remainingMinutes * 60 * 1000);
|
||||
|
||||
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const etaDay = new Date(eta);
|
||||
@@ -418,10 +418,10 @@ export function formatETA(
|
||||
*/
|
||||
export function formatDuration(seconds: number | null | undefined): string {
|
||||
if (seconds == null || seconds < 0) return '--';
|
||||
|
||||
|
||||
const hours = Math.floor(seconds / 3600);
|
||||
const minutes = Math.floor((seconds % 3600) / 60);
|
||||
|
||||
|
||||
return hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
*/
|
||||
export function formatFileSize(bytes: number): string {
|
||||
if (bytes === 0) return '0 B';
|
||||
|
||||
|
||||
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
const k = 1024;
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
|
||||
const size = bytes / Math.pow(k, i);
|
||||
|
||||
|
||||
// No decimals for bytes, 1 decimal for larger units
|
||||
return i === 0
|
||||
? `${size} ${units[i]}`
|
||||
return i === 0
|
||||
? `${size} ${units[i]}`
|
||||
: `${size.toFixed(1)} ${units[i]}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user