1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-20 13:29:37 +02:00

fix: update RegionCard component to handle undefined visited state and refactor global search API to return structured results

This commit is contained in:
Sean Morley 2025-01-18 12:57:56 -05:00
parent d60945d5b7
commit f10e171a8e
4 changed files with 129 additions and 224 deletions

View file

@ -7,7 +7,7 @@
import { t } from 'svelte-i18n';
export let region: Region;
export let visited: boolean;
export let visited: boolean | undefined;
function goToCity() {
console.log(region);
@ -64,12 +64,12 @@
</div>
<div class="card-actions justify-end">
<!-- <button class="btn btn-info" on:click={moreInfo}>More Info</button> -->
{#if !visited}
{#if !visited && visited !== undefined}
<button class="btn btn-primary" on:click={markVisited}
>{$t('adventures.mark_visited')}</button
>
{/if}
{#if visited}
{#if visited && visited !== undefined}
<button class="btn btn-warning" on:click={removeVisit}>{$t('adventures.remove')}</button>
{/if}
{#if region.num_cities > 0}