aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Reader/Chapters/MangaDex.svelte
blob: f1a90338bca0fcf5c5e8700c1b9b0fb86f797d64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<script lang="ts">
interface MangaDexChapter {
  id: string;
  attributes: {
    volume?: string;
    chapter: string;
    title?: string;
  };
}

interface MangaDexData {
  data: MangaDexChapter[];
}

export let data: MangaDexData;
</script>

<ul>
  {#each data.data as chapter}
    <li>
      {#if chapter.attributes.volume}
        Vol. {chapter.attributes.volume}
      {/if}
      Ch. {chapter.attributes.chapter}
      <span class="opaque">|</span>
      <a
        href={`https://mangadex.org/chapter/${chapter.id}`}
        target="_blank"
        rel="noopener noreferrer"
      >
        {chapter.attributes.title || 'Read'}
      </a>
    </li>
  {/each}
</ul>