From a5fce32e78f9d17cc6221ce7f175c95423cc374e Mon Sep 17 00:00:00 2001 From: developomp Date: Sat, 22 Mar 2025 20:55:51 +0900 Subject: [PATCH] feat(list): add thumbnail --- .../assets/thumbnail/content-creators.svg | 1 + apps/list/components/Card.vue | 3 +- apps/list/pages/index.vue | 36 ++++++++++++++++--- 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 apps/list/assets/thumbnail/content-creators.svg diff --git a/apps/list/assets/thumbnail/content-creators.svg b/apps/list/assets/thumbnail/content-creators.svg new file mode 100644 index 0000000..799e426 --- /dev/null +++ b/apps/list/assets/thumbnail/content-creators.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/list/components/Card.vue b/apps/list/components/Card.vue index 603ccab..e379a1c 100644 --- a/apps/list/components/Card.vue +++ b/apps/list/components/Card.vue @@ -2,6 +2,7 @@ const props = defineProps<{ href: string name: string + thumbnail: string }>() // See https://inclusive-components.design/cards/ @@ -14,7 +15,7 @@ const props = defineProps<{
- +
+type Item = { + name: string + href: string + thumbnail: string +} + +const items: Item[] = [ + { + name: "Content Creators", + href: "/content-creators", + thumbnail: "content-creators", + }, +] + +const glob = import.meta.glob("~/assets/thumbnail/*", { eager: true }) +const thumbnails = Object.fromEntries( + Object.entries(glob).map(([key, value]) => [ + key.split("/").pop().split(".")[0], + value.default, + ]), +) + +