koel/resources/assets/js/components/profile-preferences/ThemeList.vue

21 lines
577 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
<section>
2024-04-04 22:20:42 +00:00
<ul class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
<li v-for="theme in themes" :key="theme.id" data-testid="theme-card">
2022-12-02 16:17:37 +00:00
<ThemeCard :key="theme.id" :theme="theme" @selected="setTheme" />
2022-04-15 14:24:30 +00:00
</li>
</ul>
</section>
</template>
2022-04-15 17:00:08 +00:00
<script lang="ts" setup>
import { toRef } from 'vue'
2022-04-15 14:24:30 +00:00
import { themeStore } from '@/stores'
import ThemeCard from '@/components/profile-preferences/ThemeCard.vue'
2022-04-21 22:51:48 +00:00
const themes = toRef(themeStore.state, 'themes')
2022-04-15 14:24:30 +00:00
2022-04-15 17:00:08 +00:00
const setTheme = (theme: Theme) => themeStore.setTheme(theme)
2022-04-15 14:24:30 +00:00
</script>