This commit is contained in:
Eris Lund 2026-01-12 07:51:35 +09:00 committed by GitHub
commit 7e0c24b1f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 5 deletions

View file

@ -19,6 +19,7 @@ import EqToggleButton from "./EqToggleButton";
import PlaylistToggleButton from "./PlaylistToggleButton";
import Kbps from "./Kbps";
import Khz from "./Khz";
import WorkIndicator from "./work-indicator"
import Marquee from "./Marquee";
import MonoStereo from "./MonoStereo";
import Position from "./Position";
@ -99,11 +100,7 @@ const MainWindow = React.memo(({ analyser, filePickers }: Props) => {
</div>
<div className="webamp-status">
<ClutterBar />
{!working && <div id="play-pause" />}
<div
id="work-indicator"
className={classnames({ selected: working })}
/>
<WorkIndicator />
<Time />
</div>
<Vis analyser={analyser} />

View file

@ -0,0 +1,24 @@
import * as React from "react";
import classnames from "classnames";
import { useTypedSelector } from "../../hooks";
import * as Selectors from "../../selectors";
import { MEDIA_STATUS } from "../../constants";
export default function WorkIndicator() {
const kbps = useTypedSelector(Selectors.getKbps);
const khz = useTypedSelector(Selectors.getKhz);
const mediaStatus = useTypedSelector(Selectors.getMediaStatus);
const working =
mediaStatus === MEDIA_STATUS.PLAYING &&
!(kbps != null &&
khz != null &&
kbps.trim() !== "0");
return (
<div
id="work-indicator"
className={classnames({ selected: working })}
/>
);
}