2026-01-07 09:31:02 +00:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
import { Button } from '../../ui/button';
|
|
|
|
|
import { X, Calendar, ShieldBan } from 'lucide-react';
|
|
|
|
|
|
|
|
|
|
interface BanUserModalProps {
|
|
|
|
|
username: string;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
onConfirm: (reason: string, details: string, duration: string) => void;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
export const BanUserModal: React.FC<BanUserModalProps> = ({
|
|
|
|
|
username,
|
|
|
|
|
onClose,
|
|
|
|
|
onConfirm,
|
|
|
|
|
}) => {
|
2026-01-07 09:31:02 +00:00
|
|
|
const [reason, setReason] = useState('Terms of Service Violation');
|
|
|
|
|
const [details, setDetails] = useState('');
|
|
|
|
|
const [isPermanent, setIsPermanent] = useState(false);
|
|
|
|
|
const [duration, setDuration] = useState('7'); // days
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4">
|
2026-01-13 18:47:57 +00:00
|
|
|
<div
|
|
|
|
|
className="absolute inset-0 bg-kodo-void/90 backdrop-blur-sm"
|
|
|
|
|
onClick={onClose}
|
|
|
|
|
></div>
|
2026-01-07 09:31:02 +00:00
|
|
|
<div className="relative w-full max-w-md bg-kodo-graphite border border-kodo-red rounded-xl shadow-2xl animate-scaleIn overflow-hidden">
|
|
|
|
|
<div className="p-4 border-b border-kodo-red/30 bg-kodo-red/10 flex justify-between items-center">
|
|
|
|
|
<h3 className="font-bold text-kodo-red flex items-center gap-2">
|
|
|
|
|
<ShieldBan className="w-5 h-5 fill-current" /> Suspend User
|
|
|
|
|
</h3>
|
2026-01-13 18:47:57 +00:00
|
|
|
<button onClick={onClose}>
|
|
|
|
|
<X className="w-5 h-5 text-gray-400 hover:text-white" />
|
|
|
|
|
</button>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="p-6 space-y-4">
|
2026-01-13 18:47:57 +00:00
|
|
|
<p className="text-gray-300 text-sm">
|
|
|
|
|
You are about to suspend{' '}
|
|
|
|
|
<span className="font-bold text-white">{username}</span>. This will
|
|
|
|
|
restrict their access to the platform.
|
|
|
|
|
</p>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<div>
|
|
|
|
|
<label className="block text-xs font-bold text-gray-400 uppercase mb-2">
|
|
|
|
|
Reason
|
|
|
|
|
</label>
|
|
|
|
|
<select
|
|
|
|
|
className="w-full bg-kodo-void border border-kodo-steel rounded p-2 text-white focus:border-kodo-red outline-none text-sm"
|
|
|
|
|
value={reason}
|
|
|
|
|
onChange={(e) => setReason(e.target.value)}
|
|
|
|
|
>
|
|
|
|
|
<option>Terms of Service Violation</option>
|
|
|
|
|
<option>Spam or Bot Activity</option>
|
|
|
|
|
<option>Harassment / Hate Speech</option>
|
|
|
|
|
<option>Copyright Infringement</option>
|
|
|
|
|
<option>Fraudulent Activity</option>
|
|
|
|
|
<option>Other</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<div>
|
|
|
|
|
<label className="block text-xs font-bold text-gray-400 uppercase mb-2">
|
|
|
|
|
Details (Internal Note)
|
|
|
|
|
</label>
|
|
|
|
|
<textarea
|
|
|
|
|
className="w-full bg-kodo-void border border-kodo-steel rounded p-2 text-white focus:border-kodo-red outline-none text-sm resize-none h-24"
|
|
|
|
|
placeholder="Provide context for this ban..."
|
|
|
|
|
value={details}
|
|
|
|
|
onChange={(e) => setDetails(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="flex items-center justify-between p-3 bg-kodo-ink rounded border border-kodo-steel">
|
|
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<Calendar className="w-5 h-5 text-gray-400" />
|
|
|
|
|
<div>
|
|
|
|
|
<div className="text-sm font-bold text-white">Ban Duration</div>
|
|
|
|
|
<div className="text-xs text-gray-400">
|
|
|
|
|
{isPermanent ? 'Permanent Ban' : `${duration} Days`}
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<span
|
|
|
|
|
className={`text-xs ${!isPermanent ? 'text-white' : 'text-gray-500'}`}
|
|
|
|
|
>
|
|
|
|
|
Temp
|
|
|
|
|
</span>
|
|
|
|
|
<div
|
|
|
|
|
onClick={() => setIsPermanent(!isPermanent)}
|
|
|
|
|
className={`w-10 h-5 rounded-full relative cursor-pointer transition-colors ${isPermanent ? 'bg-kodo-red' : 'bg-gray-600'}`}
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
className={`absolute top-1 w-3 h-3 bg-white rounded-full transition-all ${isPermanent ? 'left-6' : 'left-1'}`}
|
|
|
|
|
></div>
|
|
|
|
|
</div>
|
|
|
|
|
<span
|
|
|
|
|
className={`text-xs ${isPermanent ? 'text-kodo-red font-bold' : 'text-gray-500'}`}
|
|
|
|
|
>
|
|
|
|
|
Perm
|
|
|
|
|
</span>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{!isPermanent && (
|
|
|
|
|
<div>
|
|
|
|
|
<label className="block text-xs font-bold text-gray-400 uppercase mb-2">
|
|
|
|
|
Days
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="number"
|
|
|
|
|
min="1"
|
|
|
|
|
className="w-full bg-kodo-void border border-kodo-steel rounded p-2 text-white focus:border-kodo-red outline-none text-sm"
|
|
|
|
|
value={duration}
|
|
|
|
|
onChange={(e) => setDuration(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="p-4 border-t border-kodo-steel bg-kodo-ink flex justify-end gap-3">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Button variant="ghost" onClick={onClose}>
|
|
|
|
|
Cancel
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="primary"
|
|
|
|
|
className="bg-red-600 hover:bg-red-700 border-red-500 text-white"
|
|
|
|
|
onClick={() =>
|
|
|
|
|
onConfirm(
|
|
|
|
|
reason,
|
|
|
|
|
details,
|
|
|
|
|
isPermanent ? 'Permanent' : `${duration} days`,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Suspend User
|
|
|
|
|
</Button>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|