import { useState } from "react";
interface MemberContextMenuProps {
memberId: string;
username: string;
canKick: boolean;
canBan: boolean;
canMute: boolean;
onMessage?: () => void;
onKick?: (reason: string) => void;
onBan?: (reason: string) => void;
onMute?: (duration: string, reason: string) => void;
onClose: () => void;
}
export function MemberContextMenu({
username,
canKick,
canBan,
canMute,
onMessage,
onKick,
onBan,
onMute,
onClose,
}: MemberContextMenuProps) {
const [mode, setMode] = useState<"menu" | "kick" | "ban" | "mute">("menu");
const [reason, setReason] = useState("");
const [duration, setDuration] = useState("1h");
if (mode === "kick") {
return (
KICK {username.toUpperCase()}
setReason(e.target.value)}
placeholder="reason (optional)"
className="terminal-input w-full mb-2"
/>
);
}
if (mode === "ban") {
return (
BAN {username.toUpperCase()}
setReason(e.target.value)}
placeholder="reason (optional)"
className="terminal-input w-full mb-2"
/>
);
}
if (mode === "mute") {
return (
MUTE {username.toUpperCase()}
setReason(e.target.value)}
placeholder="reason (optional)"
className="terminal-input w-full mb-2"
/>
);
}
return (
{canKick && (
)}
{canMute && (
)}
{canBan && (
)}
);
}