diff --git a/src/renderer/src/atoms/player.ts b/src/renderer/src/atoms/player.ts index 911734109e..a12c738484 100644 --- a/src/renderer/src/atoms/player.ts +++ b/src/renderer/src/atoms/player.ts @@ -22,7 +22,7 @@ const playerInitialValue: PlayerAtomValue = { } export const [ - playerAtom, + , usePlayerAtom, usePlayerAtomValue, useSetPlayerAtom, diff --git a/src/renderer/src/modules/entry-column/list-item-template.tsx b/src/renderer/src/modules/entry-column/list-item-template.tsx index 116e8e72af..dc4673be1b 100644 --- a/src/renderer/src/modules/entry-column/list-item-template.tsx +++ b/src/renderer/src/modules/entry-column/list-item-template.tsx @@ -180,7 +180,7 @@ function AudioCover({ > {label} @@ -218,7 +236,8 @@ const PlaybackRateSelector = () => { type="button" className={cn( "center rounded-md font-mono hover:bg-theme-item-hover", - playerValue.playbackRate === rate && "bg-theme-item-hover text-black dark:text-white", + playerValue.playbackRate === rate && + "bg-theme-item-hover text-black dark:text-white", playerValue.playbackRate !== rate && "text-zinc-500", )} onClick={() => Player.setPlaybackRate(rate)} @@ -227,7 +246,23 @@ const PlaybackRateSelector = () => { x ))} - ) } + +const PlaybackRateButton = () => { + const playerValue = usePlayerAtomValue() + + const char = `${playerValue.playbackRate || 1}` + return ( + 1 ? "text-[9px]" : "text-xs", + "block font-mono font-bold", + )} + > + {char} + x + + ) +}