@@ -23,6 +23,8 @@ import { IconError } from '@mdui/icons/error.js';
2323import { IconStar } from '@mdui/icons/star.js' ;
2424import { IconStarBorder } from '@mdui/icons/star-border.js' ;
2525
26+ import { LitElementWrapper } from '@/solit' ;
27+
2628import {
2729 type ProviderName ,
2830 ProviderNames ,
@@ -58,7 +60,9 @@ const providerBias = (p: ProviderName) =>
5860 ( lyricsStore . lyrics [ p ] . state === 'done' ? 1 : - 1 ) +
5961 ( lyricsStore . lyrics [ p ] . data ?. lines ?. length ? 2 : - 1 ) +
6062 // eslint-disable-next-line prettier/prettier
61- ( lyricsStore . lyrics [ p ] . data ?. lines ?. length && p === ProviderNames . YTMusic ? 1 : 0 ) +
63+ ( lyricsStore . lyrics [ p ] . data ?. lines ?. length && p === ProviderNames . YTMusic
64+ ? 1
65+ : 0 ) +
6266 ( lyricsStore . lyrics [ p ] . data ?. lyrics ? 1 : - 1 ) ;
6367
6468const pickBestProvider = ( ) => {
@@ -82,17 +86,6 @@ const [hasManuallySwitchedProvider, setHasManuallySwitchedProvider] =
8286export const LyricsPicker = ( props : {
8387 setStickRef : Setter < HTMLElement | null > ;
8488} ) => {
85- const doNotTreeShake = [
86- IconChevronLeft ,
87- IconChevronRight ,
88- IconCheckCircle ,
89- IconWarning ,
90- IconError ,
91- IconStar ,
92- IconStarBorder ,
93- ] ;
94- ( ( a ) => { } ) ( doNotTreeShake ) ;
95-
9689 const [ videoId , setVideoId ] = createSignal < string | null > ( null ) ;
9790 const [ starredProvider , setStarredProvider ] =
9891 createSignal < ProviderName | null > ( null ) ;
@@ -200,10 +193,13 @@ export const LyricsPicker = (props: {
200193 < div class = "lyrics-picker" ref = { props . setStickRef } >
201194 < div class = "lyrics-picker-left" >
202195 < mdui-button-icon >
203- < mdui-icon-chevron-left
204- onClick = { previous }
205- role = "button"
206- style = { { padding : '5px' } }
196+ < LitElementWrapper
197+ elementClass = { IconChevronLeft }
198+ props = { {
199+ onClick : previous ,
200+ role : 'button' ,
201+ style : { padding : '5px' } ,
202+ } }
207203 />
208204 </ mdui-button-icon >
209205 </ div >
@@ -234,9 +230,9 @@ export const LyricsPicker = (props: {
234230 />
235231 </ Match >
236232 < Match when = { currentLyrics ( ) . state === 'error' } >
237- < mdui-icon-error
238- style = { { padding : '5px' , scale : '0.8' } }
239- tabindex = "-1"
233+ < LitElementWrapper
234+ elementClass = { IconError }
235+ props = { { style : { padding : '5px' , scale : '0.8' } } }
240236 />
241237 </ Match >
242238 < Match
@@ -246,9 +242,9 @@ export const LyricsPicker = (props: {
246242 currentLyrics ( ) . data ?. lyrics )
247243 }
248244 >
249- < mdui-icon-check-circle
250- style = { { padding : '5px' , scale : '0.8' } }
251- tabindex = "-1"
245+ < LitElementWrapper
246+ elementClass = { IconCheckCircle }
247+ props = { { style : { padding : '5px' , scale : '0.8' } } }
252248 />
253249 </ Match >
254250 < Match
@@ -258,9 +254,9 @@ export const LyricsPicker = (props: {
258254 ! currentLyrics ( ) . data ?. lyrics
259255 }
260256 >
261- < mdui-icon-warning
262- style = { { padding : '5px' , scale : '0.8' } }
263- tabindex = "-1"
257+ < LitElementWrapper
258+ elementClass = { IconWarning }
259+ props = { { style : { padding : '5px' , scale : '0.8' } } }
264260 />
265261 </ Match >
266262 </ Switch >
@@ -270,10 +266,12 @@ export const LyricsPicker = (props: {
270266 />
271267 < mdui-button-icon onClick = { toggleStar } tabindex = { - 1 } >
272268 < Show
273- fallback = { < mdui-icon-star-border /> }
269+ fallback = {
270+ < LitElementWrapper elementClass = { IconStarBorder } />
271+ }
274272 when = { starredProvider ( ) === provider ( ) }
275273 >
276- < mdui-icon-star />
274+ < LitElementWrapper elementClass = { IconStar } />
277275 </ Show >
278276 </ mdui-button-icon >
279277 </ div >
@@ -298,10 +296,13 @@ export const LyricsPicker = (props: {
298296
299297 < div class = "lyrics-picker-left" >
300298 < mdui-button-icon >
301- < mdui-icon-chevron-right
302- onClick = { next }
303- role = "button"
304- style = { { padding : '5px' } }
299+ < LitElementWrapper
300+ elementClass = { IconChevronRight }
301+ props = { {
302+ onClick : next ,
303+ role : 'button' ,
304+ style : { padding : '5px' } ,
305+ } }
305306 />
306307 </ mdui-button-icon >
307308 </ div >
0 commit comments