import { useState } from "react";
import { Button } from "../button/button";
import exit from "../../../images/icons/exit.svg";
import { THOC } from "../../../utils/types";

export const ExitButton: React.FC<THOC> = ({ onClick }) => {
  const [active, setActive] = useState(false);
  const button = {
    icon: exit,
    active: "Завершить презентацию",
    inactive: "Завершить презентацию",
    type: "exit",
  };

  function handleClick() {
    console.log("click");
    setActive((prev) => !prev);
    onClick()
  }

  return (
    <div className="toolbar-button-area">
      <Button  button={button} onClick={handleClick}></Button>
    </div>
  );
};