Add flag column to worldTravelCountries table and remove flag column

This commit is contained in:
Sean Morley
2024-04-12 14:20:34 +00:00
parent 61458b3cc2
commit b0b8a2794b
6 changed files with 673 additions and 3 deletions

View File

@@ -8,13 +8,23 @@
async function nav(loc: string) {
goto(`/worldtravel/${loc}`);
}
function getFlag(country: string) {
return `https://flagcdn.com/h24/${country}.png`;
}
</script>
<h1>Country List</h1>
<h1 class="text-center font-bold text-4xl mb-4">Country List</h1>
{#each data.response as item}
<button class="btn btn-primary" on:click={() => nav(item.country_code)}
>{item.name}</button
<button
class="btn btn-primary mr-4 mb-2"
on:click={() => nav(item.country_code)}
>{item.name}
<img
src={getFlag(item.country_code)}
class="inline-block -mt-1 mr-1"
alt="Flag"
/></button
>
<!-- <p>Name: {item.name}, Continent: {item.continent}</p> -->
{/each}