mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 21:10:12 +02:00
add current song styles to rowIndex and title columns
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { usePlayerSong } from '/@/renderer/store';
|
||||
import { QueueSong } from '/@/shared/types/domain-types';
|
||||
|
||||
export const useIsCurrentSong = (song: QueueSong) => {
|
||||
const currentSong = usePlayerSong();
|
||||
|
||||
const isActive = useMemo(() => {
|
||||
return song._uniqueId === currentSong?._uniqueId;
|
||||
}, [song._uniqueId, currentSong?._uniqueId]);
|
||||
|
||||
return { isActive };
|
||||
};
|
||||
Reference in New Issue
Block a user