<script>
  import { nhentaiGetWork } from '../../services/api';
  import SvelteButton from '../1-atoms/SvelteButton.svelte';
  import { t } from '../../services/utils';

  let galleryId;
  let work;

  async function handleClick() {
    work = await nhentaiGetWork(galleryId);
  }
</script>

<div class="nhentai-get-work">
  <label><input type="text" placeholder="177013" bind:value="{galleryId}" /></label
  ><SvelteButton on:click="{handleClick}">{t('Get')}</SvelteButton>
  <div>{JSON.stringify(work)}</div>
</div>
