import { useCallback } from "react";
import { useDispatch } from "react-redux";
import { Button } from "antd";
import styles from "./index.module.less";

export default function ReplayButton() {
  const dispatch = useDispatch();

  const playHandler = useCallback(() => {
    dispatch.data.update({ replayVersion: Date.now() });
  }, []);

  return (
    <div className={styles.replayButton}>
      <Button type="primary" onClick={playHandler}>
        播放
      </Button>
    </div>
  );
}
