Files
radicle-explorer/src/Reactions.svelte
T
Sebastian Martinez c5d5053f0c Add patches
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2022-08-01 13:06:30 +02:00

28 lines
722 B
Svelte

<script lang="ts">
import { createEventDispatcher } from "svelte";
export let reactions: Record<string, number> | null = null;
const dispatch = createEventDispatcher();
</script>
<style>
.reaction {
margin-right: 0.6rem;
padding: 0 0.6rem;
height: 26px;
min-width: unset; /* Resets min-width from button in public.css */
}
</style>
{#if reactions}
<div class="reactions">
{#each Object.entries(reactions) as [reaction, count]}
<!-- TODO: Remove the disabled attribute once we are able to increment reactions -->
<button disabled class="reaction text-xsmall" on:click={() => dispatch("click", reaction)}>
{reaction} {count}
</button>
{/each}
</div>
{/if}