-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor stop generating button to not have useless dispatch event
- Loading branch information
Showing
3 changed files
with
7 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher } from "svelte"; | ||
import CarbonPause from "~icons/carbon/pause-filled"; | ||
export let visible: boolean = false; | ||
export let className = ""; | ||
const dispatch = createEventDispatcher<{ stop: string }>(); | ||
</script> | ||
|
||
<button | ||
type="button" | ||
on:click | ||
class="absolute btn flex rounded-lg border py-1 px-3 shadow-sm bg-white dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:border-gray-600 transition-all | ||
{className} | ||
{visible ? 'opacity-100 visible' : 'opacity-0 invisible'} | ||
" | ||
on:click={() => dispatch("stop")} | ||
> | ||
<CarbonPause class="mr-1 -ml-1 w-[1.1875rem] h-[1.25rem] text-gray-400" /> Stop generating | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters