feat: format fileSize cols in summary databases

This commit is contained in:
Pavel
2025-08-14 19:21:04 +02:00
parent d8081277ee
commit 02ee327595
2 changed files with 12 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import TableControl from '../elements/TableControl.svelte';
import formatFileSize from '../utility/formatFileSize';
export let rows: any[] = [];
export let columns: any[] = [];
@@ -7,6 +8,13 @@
const tableColumns = columns.map(col => ({
header: col.header,
fieldName: col.fieldName,
type: col.type || 'data',
formatter: (row, col) => {
const value = row[col.fieldName];
if (col.type === 'fileSize') return formatFileSize(value);
return value;
},
}));
</script>