/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/

// FullScreenButton.jsx
import React from "react";
import { useLocation } from "react-router-dom";
import { Button } from "@/components/ui/button" // Update this path as needed
import { Maximize2 } from 'lucide-react'

const FullScreenButton = () => {
  const location = useLocation();

  // Logic to determine text and link
  const isPbftPage = location.pathname === "/pbft";
  const buttonText = isPbftPage ? "Back to Home" : "Maximize the view";
  const buttonLink = isPbftPage ? "/#" : "/pbft";

  return (
    <div>
      <a href={buttonLink}>
        <Button variant="outline" className="full-screen-button">
          <Maximize2 className="mr-2 h-4 w-4" />
          {buttonText}
        </Button>
      </a>
    </div>
  );
};

export default FullScreenButton;
