Files
radicle-explorer/src/components/List.svelte
T
Rūdolfs Ošiņšanddnlklmn d914710396 Implement new design
Co-authored-by: dnlklmn <pelicansinberlin@gmail.com>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
2023-10-13 18:05:19 +02:00

45 lines
722 B
Svelte

<script lang="ts">
type T = $$Generic;
export let items: T[];
</script>
<style>
.list {
border-radius: var(--border-radius-small);
border: 1px solid var(--color-border-hint);
}
.list-item:not(:last-child) {
border-bottom: 1px solid var(--color-border-hint);
}
.header {
padding: 0.5rem;
border-bottom: 1px solid var(--color-border-hint);
}
@media (max-width: 720px) {
.list {
border-radius: 0;
}
}
</style>
<div class="list">
{#if $$slots.header}
<div class="header">
<slot name="header" />
</div>
{/if}
{#each items as item}
<div class="list-item">
<slot name="item" {item} />
</div>
{/each}
<slot name="body" />
</div>