27 lines
963 B
Vue
27 lines
963 B
Vue
<script setup lang="ts">
|
|
|
|
import {mammonAddCharacterUrl} from "@/mammon";
|
|
import {storeToRefs} from "pinia";
|
|
import {CharacterLabel, useCharactersStore} from "@/characters";
|
|
import {ArrowPathIcon} from '@heroicons/vue/24/outline';
|
|
|
|
const charactersStore = useCharactersStore()
|
|
const {characters} = storeToRefs(charactersStore);
|
|
const {reloadActivities} = charactersStore;
|
|
|
|
const addCharacter = () => {
|
|
window.location.replace(mammonAddCharacterUrl);
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div class="grid mb-2 mt-4">
|
|
<div class="mb-4 border-b-1 flex justify-end">
|
|
<button class="mb-2" @click="addCharacter">Add chacarcter</button>
|
|
</div>
|
|
<div v-for="character in characters" :key="character.characterId" class="flex items-center mb-2">
|
|
<CharacterLabel class="grow" :character="character" />
|
|
<button class="btn-icon" @click="reloadActivities(character.characterId)"><ArrowPathIcon /></button>
|
|
</div>
|
|
</div>
|
|
</template> |