paimon-moe/src/components/TodoDeleteModal.svelte

39 lines
1.5 KiB
Svelte
Raw Normal View History

2020-11-08 20:57:56 +01:00
<script>
2021-03-14 11:23:17 +01:00
import { t} from "svelte-i18n";
2020-11-08 20:57:56 +01:00
import Button from './Button.svelte';
export let todo;
export let deleteTodo;
export let cancel;
</script>
<div>
2021-03-14 11:23:17 +01:00
<p class="text-white font-bold mb-4 text-lg">{$t('todo.delete.title')}</p>
2020-11-08 20:57:56 +01:00
<div class="flex items-center mb-4 text-white">
{#if todo.type === 'weapon'}
<img
class="h-8 inline-block mr-2"
src={`/images/weapons/${todo.weapon ? todo.weapon.id : 'any_weapon_1'}.png`}
alt={todo.weapon ? todo.weapon.name : `Weapon Level ${todo.level.from}-${todo.level.to}`} />
<div class="flex-1">
<p class="font-bold">{todo.weapon ? todo.weapon.name : 'Weapon'}</p>
<p class="text-gray-500">Level {`${todo.level.from}-${todo.level.to}`}</p>
</div>
{:else if todo.type === 'character'}
<img
class="h-8 inline-block mr-2"
src={`/images/characters/${todo.character ? todo.character.id : 'characters'}.png`}
alt={todo.character ? todo.character.name : `Character Level ${todo.level.from}-${todo.level.to}`} />
<div class="flex-1">
<p class="font-bold">{todo.character ? todo.character.name : 'Character'}</p>
<p class="text-gray-500">Level {`${todo.level.from}-${todo.level.to}`}</p>
</div>
{/if}
</div>
2021-04-23 22:05:54 +02:00
<div class="flex justify-end space-x-2">
2021-03-14 11:23:17 +01:00
<Button on:click={cancel}>{$t('todo.delete.cancel')}</Button>
<Button on:click={deleteTodo} color="red">{$t('todo.delete.delete')}</Button>
2020-11-08 20:57:56 +01:00
</div>
</div>