2024-03-29 21:41:22 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { createEventDispatcher } from 'svelte';
|
2024-03-30 21:26:21 +00:00
|
|
|
import locationDot from "$lib/assets/locationDot.svg";
|
|
|
|
import calendar from "$lib/assets/calendar.svg";
|
2024-03-29 21:41:22 +00:00
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
|
2024-04-02 21:33:41 +00:00
|
|
|
export let type:String;
|
|
|
|
|
2024-03-29 21:41:22 +00:00
|
|
|
export let name:String;
|
|
|
|
export let location:String;
|
|
|
|
export let created:string;
|
|
|
|
export let id:Number;
|
|
|
|
|
|
|
|
function remove() {
|
2024-03-29 22:44:26 +00:00
|
|
|
dispatch('remove', id);
|
2024-03-29 21:41:22 +00:00
|
|
|
}
|
|
|
|
function edit() {
|
|
|
|
dispatch('edit', id)
|
|
|
|
}
|
2024-04-02 21:33:41 +00:00
|
|
|
function add() {
|
|
|
|
dispatch('add', {name, location});
|
|
|
|
}
|
2024-03-29 21:41:22 +00:00
|
|
|
</script>
|
|
|
|
|
2024-04-02 21:33:41 +00:00
|
|
|
{#if type === 'mylog'}
|
|
|
|
|
2024-04-01 21:35:21 +00:00
|
|
|
<div class="card min-w-max lg:w-96 md:w-80 sm:w-60 xs:w-40 bg-neutral shadow-xl overflow-hidden">
|
2024-03-30 21:26:21 +00:00
|
|
|
<div class="card-body">
|
|
|
|
<h2 class="card-title overflow-ellipsis">{name}</h2>
|
2024-04-02 21:33:41 +00:00
|
|
|
{#if location !== ""}
|
2024-03-30 21:26:21 +00:00
|
|
|
<p><img src={locationDot} class="inline-block -mt-1 mr-1" alt="Logo" />{location}</p>
|
2024-04-02 21:33:41 +00:00
|
|
|
{/if}
|
|
|
|
{#if created !== ""}
|
2024-03-30 21:26:21 +00:00
|
|
|
<p><img src={calendar} class="inline-block -mt-1 mr-1" alt="Logo" />{created}</p>
|
2024-04-02 21:33:41 +00:00
|
|
|
{/if}
|
2024-03-30 21:26:21 +00:00
|
|
|
<div class="card-actions justify-end">
|
|
|
|
<button class="btn btn-primary" on:click={edit}>Edit</button>
|
|
|
|
<button class="btn btn-secondary" on:click={remove}>Remove</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-29 21:41:22 +00:00
|
|
|
</div>
|
|
|
|
|
2024-04-02 21:33:41 +00:00
|
|
|
{/if}
|
|
|
|
|
|
|
|
{#if type === 'featured'}
|
|
|
|
|
|
|
|
<div class="card min-w-max lg:w-96 md:w-80 sm:w-60 xs:w-40 bg-neutral shadow-xl overflow-hidden">
|
|
|
|
<div class="card-body">
|
|
|
|
<h2 class="card-title overflow-ellipsis">{name}</h2>
|
|
|
|
{#if location!=""}
|
|
|
|
<p><img src={locationDot} class="inline-block -mt-1 mr-1" alt="Logo" />{location}</p>
|
|
|
|
{/if}
|
|
|
|
<div class="card-actions justify-end">
|
|
|
|
<button class="btn btn-primary" on:click={add}>Add</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{/if}
|