refactor: use Component type for EFFECT_ICONS in PlayerPanel
This commit is contained in:
2 files changed
+19
-6
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, toRef, watch } from 'vue'
|
||||
import { computed, ref, toRef, watch, type Component } from 'vue'
|
||||
import {
|
||||
Activity,
|
||||
Bot,
|
||||
@@ -95,7 +95,7 @@ async function commitVolume() {
|
||||
draggedVolume.value = null
|
||||
}
|
||||
|
||||
const EFFECT_ICONS: Record<string, any> = {
|
||||
const EFFECT_ICONS: Record<string, Component> = {
|
||||
zap: Zap,
|
||||
sparkles: Sparkles,
|
||||
waves: Waves,
|
||||
@@ -338,9 +338,15 @@ async function cycleLoop() {
|
||||
<span class="volume-value">{{ volume }}%</span>
|
||||
</div>
|
||||
|
||||
<div v-if="effects.length" class="effects-container">
|
||||
<div
|
||||
v-if="effects.length"
|
||||
class="effects-container"
|
||||
>
|
||||
<div class="effects-header">
|
||||
<SlidersHorizontal :size="13" class="effects-header-icon" />
|
||||
<SlidersHorizontal
|
||||
:size="13"
|
||||
class="effects-header-icon"
|
||||
/>
|
||||
<span class="effects-header-title">Efekty odtwarzacza</span>
|
||||
</div>
|
||||
<div class="effects-grid">
|
||||
@@ -353,7 +359,11 @@ async function cycleLoop() {
|
||||
:title="fx.name"
|
||||
@click="onToggleEffect(fx)"
|
||||
>
|
||||
<component :is="effectIcon(fx.icon)" :size="15" class="effect-icon" />
|
||||
<component
|
||||
:is="effectIcon(fx.icon)"
|
||||
:size="15"
|
||||
class="effect-icon"
|
||||
/>
|
||||
<span class="effect-name">{{ fx.name }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -164,7 +164,10 @@ async function restoreQueue() {
|
||||
title="Przywróć kolejkę zapisaną przed ostatnim zatrzymaniem lub rozłączeniem"
|
||||
@click="restoreQueue"
|
||||
>
|
||||
<LoaderCircle v-if="restoring" class="restore-spinner" />
|
||||
<LoaderCircle
|
||||
v-if="restoring"
|
||||
class="restore-spinner"
|
||||
/>
|
||||
<RotateCcw v-else />
|
||||
<span>{{ restoring ? 'Przywracanie kolejki…' : 'Przywróć ostatnią kolejkę' }}</span>
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user