movie-night-web/app/pages/lists/index.vue

51 lines
1.3 KiB
Vue
Raw Normal View History

2026-02-16 19:12:00 -06:00
<script lang="ts" setup>
import PageTitle from "~/components/common/page-title.vue";
import CreateListForm from "~/components/forms/create-list-form.vue";
2026-02-24 00:30:07 -06:00
import type {List} from "~/types/list";
const {data: lists, refresh} = await useApiData<List[]>("/api/movielists")
const refreshLists = () => {
refresh()
}
2026-02-16 19:12:00 -06:00
</script>
<template>
<PageTitle title="Lists"/>
<div class="content">
2026-02-24 00:30:07 -06:00
<CreateListForm @refreshLists="refreshLists"/>
2026-02-16 19:12:00 -06:00
<div class="w-full flex flex-col gap-5">
<h2 class="text-2xl font-bold">Your Lists</h2>
<ul class="w-full flex flex-col gap-3">
2026-02-24 00:30:07 -06:00
<li v-for="list in lists"
:key="list.id"
class="flex justify-between items-center p-4 bg-gray-700/50 rounded-lg hover:bg-gray-600/50 transition-colors">
<NuxtLink :to="`lists/${list.id}`">{{ list.name }}</NuxtLink>
2026-02-16 19:12:00 -06:00
</li>
</ul>
</div>
<div class="w-full flex flex-col gap-5">
<h2 class="text-2xl font-bold">Shared With You</h2>
<ul class="w-full flex flex-col gap-3">
<li class="flex justify-between items-center p-4 bg-gray-700/50 rounded-lg hover:bg-gray-600/50 transition-colors">
<NuxtLink to="lists/2">Bob's List</NuxtLink>
</li>
</ul>
</div>
</div>
</template>
<style scoped>
.content {
display: flex;
flex-direction: column;
gap: 2rem;
}
</style>