]> git.lizzy.rs Git - frontend-next.git/blob - src/routes/languages.svelte
9f14e18c7370c3dd4b51151c01a354a79812053c
[frontend-next.git] / src / routes / languages.svelte
1 <!-- This file is part of api-worker <https://github.com/senpy-club/api-worker>.
2 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, version 3.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
17 SPDX-License-Identifier: GPL-3.0-only -->
18 <script>
19   import { onMount } from "svelte";
20   import { fetchLanguages } from "$lib/api";
21   let languages;
22   let complete = false;
23
24   onMount(async () => {
25     languages = await fetchLanguages();
26     complete = true;
27   });
28 </script>
29
30 <svelte:head>
31   <title>languages | senpy-club</title>
32 </svelte:head>
33
34 <div class="content">
35   <h1>Languages</h1>
36
37   {#if !complete}
38     <p>Fetching languages...</p>
39   {:else}
40     <ul>
41       {#each languages as language}
42         <li>
43           {#if language === "C#"}
44             <a href={"/language?language=C%23"}>C#</a>
45           {:else}
46             <a href={"/language?language=" + language}>
47               {language}
48             </a>
49           {/if}
50         </li>
51       {/each}
52     </ul>
53   {/if}
54 </div>