aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List/ListTitle.svelte
blob: 1513e78c774af6a3d36dd4ba5a668fb1a3d4b9b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<script lang="ts">
	import tooltip from '$lib/Tooltip/tooltip';

	export let time: number | undefined = undefined;
	export let count = -1337;
	export let title: Title = {
		title: 'Media List',
		hint: 'This is a media list.'
	};
	export let progress: undefined | number = undefined;

	interface Title {
		title: string;
		hint: string;
	}
</script>

<summary>
	<span title={title.hint || undefined} use:tooltip>{title.title}</span>
	[{count === -1337 ? '...' : count}]
	<small style="opacity: 50%">{time ? time.toFixed(3) : '...'}s</small>
	<slot />
	{#if progress !== undefined}
		<button class="badge unclickable-button button-badge badge-info">
			{progress.toFixed(0)}%
		</button>
	{/if}
</summary>