"use client";
import React from "react";

interface LogoutModalProps {
  isOpen: boolean;
  onCancel: () => void;
  onConfirm: () => void;
}

export default function LogoutModal({ isOpen, onCancel, onConfirm }: LogoutModalProps) {
  if (!isOpen) return null;

  return (
    <div className="fixed inset-0 bg-black bg-opacity-40 flex items-center justify-center z-50">
      <div className="bg-white rounded-lg p-6 w-80 shadow-lg text-center">
        <h2 className="text-lg font-semibold text-gray-900 mb-4">
          Confirm Logout
        </h2>
        <p className="text-gray-600 mb-6">
          Are you sure you want to logout?
        </p>

        <div className="flex justify-between gap-4">
          <button
            className="w-1/2 py-2 rounded bg-gray-200 hover:bg-gray-300 transition"
            onClick={onCancel}
          >
            Cancel
          </button>

          <button
            className="w-1/2 py-2 rounded bg-red-600 text-white hover:bg-red-700 transition"
            onClick={onConfirm}
          >
            Logout
          </button>
        </div>
      </div>
    </div>
  );
}