<template>
  <section class="section">
    <h2 class="title">La semaine prochaine</h2>
    <MovieCardFull :film="firstFilm" />
  </section>
  <section class="section">
    <h2 class="title">Et après</h2>
    <MovieCardFull
      v-for="film of nextFilms"
      :key="film.id"
      :film="film"
      class="block"
    />
  </section>
</template>

<script setup lang="ts">
import { Film } from "~/composables/types"

const films = ref<Film[]>()
films.value = (await apiGet<Film[]>(`films/`)).data.value
const firstFilm = computed(() => films.value[0])
const nextFilms = computed(() => films.value.slice(1))
</script>
