-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayButton.tsx
27 lines (26 loc) · 864 Bytes
/
PlayButton.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { MouseEventHandler } from "react";
import { BsFillPlayFill } from "react-icons/bs";
import { GrPowerReset } from "react-icons/gr";
export function PlayButton({
handlerRunVisualizer,
isDisabled,
isGraphVisualized,
}: {
isDisabled: boolean;
isGraphVisualized: boolean;
handlerRunVisualizer: MouseEventHandler<HTMLButtonElement>;
}) {
return (
<button
disabled={isDisabled}
onClick={handlerRunVisualizer}
className="disabled:pointer-events-none disabled:opacity-50 transition ease-in rounded-full p-2.5 shadow-md bg-green-500 hover:bg-green-600 border-none active:ring-green-300 focus:outline-none focus:ring focus:ring-green-300 focus:ring-opacity-30"
>
{isGraphVisualized ? (
<GrPowerReset className="w-5 h-5" />
) : (
<BsFillPlayFill className="w-5 h-5" />
)}
</button>
);
}