diffuse-the-rest / src /lib /ShareWithCommunity.svelte
mishig's picture
mishig HF staff
wip: automatic post
ef03766
raw
history blame
682 Bytes
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import IconCommunity from "./IconCommunity.svelte";
import IconSpinner from "./IconSpinner.svelte";
export let isUploading: boolean;
const dispatch = createEventDispatcher();
function handleClick(){
dispatch('createCommunityPost');
}
</script>
<div class="flex items-center justify-center bg-black w-[12.5rem] px-2 py-1 gap-x-2 rounded-full cursor-pointer"
on:click={handleClick}
>
{#if isUploading}
<IconSpinner classNames="text-white animate-spin" />
{:else}
<IconCommunity/>
{/if}
<p class="text-white font-semibold">Share to community</p>
</div>