Format *.ts, *.js, *.css, *.html, *.json and *.svelte

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2022-08-31 17:47:07 +02:00
parent 687174a8e0
commit b3cec1f314
148 changed files with 4040 additions and 2555 deletions
+15 -4
View File
@@ -2,7 +2,12 @@
import { createEventDispatcher } from "svelte";
import Badge from "@app/Badge.svelte";
export let items: { key: string; title: string; value: string; badge: string | null }[];
export let items: {
key: string;
title: string;
value: string;
badge: string | null;
}[];
export let selected: string | null = null;
const dispatch = createEventDispatcher();
@@ -30,7 +35,8 @@
align-items: center;
gap: 0.5rem;
}
.dropdown-item:hover, .selected {
.dropdown-item:hover,
.selected {
background-color: var(--color-foreground-background-lighter);
}
@media (max-width: 720px) {
@@ -42,9 +48,14 @@
</style>
<div class="dropdown">
{#each items as {key, value, badge, title}}
{#each items as { key, value, badge, title }}
{#if key && value}
<div class="dropdown-item" class:selected={value === selected} on:click={() => onSelect(value)} {title}>{@html key}
<div
class="dropdown-item"
class:selected={value === selected}
on:click={() => onSelect(value)}
{title}>
{@html key}
{#if badge}
<Badge variant="primary">{badge}</Badge>
{/if}