fix(icons): remove dynamic imports

This commit is contained in:
DecDuck
2024-12-24 10:49:04 +11:00
parent 8945196633
commit 0f10626b1b

View File

@ -70,10 +70,13 @@
<td <td
class="whitespace-nowrap inline-flex gap-x-4 px-3 py-4 text-sm text-zinc-400" class="whitespace-nowrap inline-flex gap-x-4 px-3 py-4 text-sm text-zinc-400"
> >
<component <IconsWindowsLogo
v-for="platform in platforms"
:is="icons[platform]"
class="text-blue-600 w-6 h-6" class="text-blue-600 w-6 h-6"
v-if="platforms.includes(Platform.Windows)"
/>
<IconsLinuxLogo
class="text-blue-600 w-6 h-6"
v-if="platforms.includes(Platform.Linux)"
/> />
<span <span
v-if="platforms.length == 0" v-if="platforms.length == 0"
@ -159,13 +162,13 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { IconsWindowsLogo } from "#build/components";
import { PlusIcon } from "@heroicons/vue/20/solid"; import { PlusIcon } from "@heroicons/vue/20/solid";
import { ArrowTopRightOnSquareIcon } from "@heroicons/vue/24/outline"; import { ArrowTopRightOnSquareIcon } from "@heroicons/vue/24/outline";
import { StarIcon } from "@heroicons/vue/24/solid"; import { StarIcon } from "@heroicons/vue/24/solid";
import { Platform, type Game, type GameVersion } from "@prisma/client"; import { Platform, type Game, type GameVersion } from "@prisma/client";
import { micromark } from "micromark"; import { micromark } from "micromark";
import moment from "moment"; import moment from "moment";
import { IconsLinuxLogo, IconsWindowsLogo } from "#components";
const route = useRoute(); const route = useRoute();
const gameId = route.params.id.toString(); const gameId = route.params.id.toString();
@ -206,10 +209,6 @@ const platforms = game.versions
.map((e) => e.platform) .map((e) => e.platform)
.flat() .flat()
.filter((e, i, u) => u.indexOf(e) === i); .filter((e, i, u) => u.indexOf(e) === i);
const icons = {
[Platform.Linux]: IconsLinuxLogo,
[Platform.Windows]: IconsWindowsLogo,
};
const rating = Math.round(game.mReviewRating * 5); const rating = Math.round(game.mReviewRating * 5);
const ratingArray = Array(5) const ratingArray = Array(5)