diff --git a/frontend/src/lib/components/AlbumPanel.svelte b/frontend/src/lib/components/AlbumPanel.svelte index 976c46b..e5ae80e 100644 --- a/frontend/src/lib/components/AlbumPanel.svelte +++ b/frontend/src/lib/components/AlbumPanel.svelte @@ -4,6 +4,7 @@ import Icon from './Icon.svelte'; import CoverPicker from './CoverPicker.svelte'; import Comments from './Comments.svelte'; + import PanelSection from './PanelSection.svelte'; import { albums } from '$lib/stores/albums.svelte'; import { auth } from '$lib/stores/auth.svelte'; import type { Album, Photo } from '$lib/types'; @@ -86,6 +87,18 @@ node.select(); } + function formatSize(bytes: number): string { + if (!bytes) return '—'; + const units = ['Б', 'КБ', 'МБ', 'ГБ']; + let v = bytes; + let i = 0; + while (v >= 1024 && i < units.length - 1) { + v /= 1024; + i++; + } + return `${i > 0 && v < 10 ? v.toFixed(1) : Math.round(v)} ${units[i]}`; + } + async function resetCover() { if (!album) return; try { @@ -102,76 +115,88 @@ {#if photoId} {#if photo} -
{nameError}
{/if} - {:else if canRename} - - {:else} -{nameError}
{/if} + {:else if canRename} + + {:else} +{album.description}
{/if}{album.photos_count ?? 0} фото · {album.members_count ?? 0} участников
{#if error}{error}
{/if} -