mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
40 lines
766 B
Vue
40 lines
766 B
Vue
<template>
|
|
<component :is="getComponent()?.component" v-bind="getComponent()?.props" />
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import ArtistGrid from "./ArtistGrid.vue";
|
|
import TracksGrid from "./TracksGrid.vue";
|
|
|
|
const props = defineProps<{
|
|
name: string;
|
|
isOnSearchPage?: boolean;
|
|
}>();
|
|
|
|
function getComponent() {
|
|
switch (props.name) {
|
|
case "tracks":
|
|
return {
|
|
component: TracksGrid,
|
|
props: {
|
|
isOnSearchPage: props.isOnSearchPage,
|
|
},
|
|
};
|
|
case "albums":
|
|
return {
|
|
component: ArtistGrid,
|
|
props: {
|
|
album_grid: true,
|
|
},
|
|
};
|
|
case "artists":
|
|
return {
|
|
component: ArtistGrid,
|
|
props: {},
|
|
};
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
</script>
|