// src/components/navbar/MenuBtn.jsx
import React from "react";
import { cn } from "../../utils/navbar";

export default function MenuBtn({ onAction, children, danger = false }) {
  return (
    <button
      type="button"
      className={cn(
        "w-full flex gap-2 items-center text-right rounded-xl text-sm font-semibold px-3 py-2 transition",
        danger ? "text-red-600 dark:text-red-300 hover:bg-red-500/10" : "text-black dark:text-white hover:bg-[#A1E3F980] dark:hover:bg-white/10"
      )}
      onPointerDown={(e) => {
        e.preventDefault();
        e.stopPropagation();
      }}
      onClick={(e) => {
        e.preventDefault();
        e.stopPropagation();
        onAction?.();
      }}
    >
      {children}
    </button>
  );
}
