Poster.vue
762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<script setup lang="ts">
//#region --Props--.
import { FilmIcon } from "lucide-vue-next";
defineProps({
  src: {
    type: String,
    required: true,
    nullable: false,
  },
  title: {
    type: String,
    required: true,
    nullable: false,
  },
});
//#endregion
</script>
<template>
  <section class="w-full md:w-1/3 lg:w-1/4">
    <div class="rounded-lg overflow-hidden shadow-lg bg-gray-800">
      <img
        v-if="src"
        :alt="title"
        :src="`https://image.tmdb.org/t/p/w500${src}`"
        class="w-full h-auto"
      />
      <div v-else class="aspect-[2/3] bg-gray-700 flex items-center justify-center">
        <FilmIcon :size="64" class="text-gray-500" />
      </div>
    </div>
  </section>
</template>
<style scoped>
</style>