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}>
|
2026-02-08 23:04:51 +00:00
|
|
|
<X className="w-5 h-5 text-muted-foreground hover:text-white" />
|
2026-01-13 18:47:57 +00:00
|
|
|
</button>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="p-6 space-y-4">
|
2026-01-16 00:59:31 +00:00
|
|
|
<p className="text-kodo-text-main text-sm">
|
2026-01-13 18:47:57 +00:00
|
|
|
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>
|
2026-02-08 23:04:51 +00:00
|
|
|
<label className="block text-xs font-bold text-muted-foreground uppercase mb-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
Reason
|
|
|
|
|
</label>
|
|
|
|
|
<select
|
ui(tokens): migrate border-kodo-steel to border-border (86 files, 269 instances)
Replace legacy hardcoded border-kodo-steel (RGB 59,69,84, theme-unaware)
with semantic border-border token across 86 user-facing components.
Covers UI primitives (checkbox, badge, modal, table, textarea, alert,
radio-group, avatar), all modals, settings views, social features,
playlist views, inventory, chat, commerce, and cloud file browser.
Only story/test files retain the legacy token.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 23:07:00 +00:00
|
|
|
className="w-full bg-kodo-void border border-border rounded p-2 text-white focus:border-kodo-red outline-none text-sm"
|
2026-01-13 18:47:57 +00:00
|
|
|
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>
|
2026-02-08 23:04:51 +00:00
|
|
|
<label className="block text-xs font-bold text-muted-foreground uppercase mb-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
Details (Internal Note)
|
|
|
|
|
</label>
|
|
|
|
|
<textarea
|
ui(tokens): migrate border-kodo-steel to border-border (86 files, 269 instances)
Replace legacy hardcoded border-kodo-steel (RGB 59,69,84, theme-unaware)
with semantic border-border token across 86 user-facing components.
Covers UI primitives (checkbox, badge, modal, table, textarea, alert,
radio-group, avatar), all modals, settings views, social features,
playlist views, inventory, chat, commerce, and cloud file browser.
Only story/test files retain the legacy token.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 23:07:00 +00:00
|
|
|
className="w-full bg-kodo-void border border-border rounded p-2 text-white focus:border-kodo-red outline-none text-sm resize-none h-24"
|
2026-01-13 18:47:57 +00:00
|
|
|
placeholder="Provide context for this ban..."
|
|
|
|
|
value={details}
|
|
|
|
|
onChange={(e) => setDetails(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
ui(tokens): migrate border-kodo-steel to border-border (86 files, 269 instances)
Replace legacy hardcoded border-kodo-steel (RGB 59,69,84, theme-unaware)
with semantic border-border token across 86 user-facing components.
Covers UI primitives (checkbox, badge, modal, table, textarea, alert,
radio-group, avatar), all modals, settings views, social features,
playlist views, inventory, chat, commerce, and cloud file browser.
Only story/test files retain the legacy token.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 23:07:00 +00:00
|
|
|
<div className="flex items-center justify-between p-4 bg-kodo-ink rounded border border-border">
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="flex items-center gap-4">
|
2026-02-08 23:04:51 +00:00
|
|
|
<Calendar className="w-5 h-5 text-muted-foreground" />
|
2026-01-13 18:47:57 +00:00
|
|
|
<div>
|
|
|
|
|
<div className="text-sm font-bold text-white">Ban Duration</div>
|
2026-02-08 23:04:51 +00:00
|
|
|
<div className="text-xs text-muted-foreground">
|
2026-01-13 18:47:57 +00:00
|
|
|
{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
|
2026-02-08 23:04:51 +00:00
|
|
|
className={`text-xs ${!isPermanent ? 'text-white' : 'text-muted-foreground'}`}
|
2026-01-13 18:47:57 +00:00
|
|
|
>
|
|
|
|
|
Temp
|
|
|
|
|
</span>
|
|
|
|
|
<div
|
|
|
|
|
onClick={() => setIsPermanent(!isPermanent)}
|
2026-01-16 00:59:31 +00:00
|
|
|
className={`w-10 h-5 rounded-full relative cursor-pointer transition-colors ${isPermanent ? 'bg-kodo-red' : 'bg-kodo-steel'}`}
|
2026-01-13 18:47:57 +00:00
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
className={`absolute top-1 w-3 h-3 bg-white rounded-full transition-all ${isPermanent ? 'left-6' : 'left-1'}`}
|
|
|
|
|
></div>
|
|
|
|
|
</div>
|
|
|
|
|
<span
|
2026-02-08 23:04:51 +00:00
|
|
|
className={`text-xs ${isPermanent ? 'text-kodo-red font-bold' : 'text-muted-foreground'}`}
|
2026-01-13 18:47:57 +00:00
|
|
|
>
|
|
|
|
|
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>
|
2026-02-08 23:04:51 +00:00
|
|
|
<label className="block text-xs font-bold text-muted-foreground uppercase mb-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
Days
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="number"
|
|
|
|
|
min="1"
|
ui(tokens): migrate border-kodo-steel to border-border (86 files, 269 instances)
Replace legacy hardcoded border-kodo-steel (RGB 59,69,84, theme-unaware)
with semantic border-border token across 86 user-facing components.
Covers UI primitives (checkbox, badge, modal, table, textarea, alert,
radio-group, avatar), all modals, settings views, social features,
playlist views, inventory, chat, commerce, and cloud file browser.
Only story/test files retain the legacy token.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 23:07:00 +00:00
|
|
|
className="w-full bg-kodo-void border border-border rounded p-2 text-white focus:border-kodo-red outline-none text-sm"
|
2026-01-13 18:47:57 +00:00
|
|
|
value={duration}
|
|
|
|
|
onChange={(e) => setDuration(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
|
ui(tokens): migrate border-kodo-steel to border-border (86 files, 269 instances)
Replace legacy hardcoded border-kodo-steel (RGB 59,69,84, theme-unaware)
with semantic border-border token across 86 user-facing components.
Covers UI primitives (checkbox, badge, modal, table, textarea, alert,
radio-group, avatar), all modals, settings views, social features,
playlist views, inventory, chat, commerce, and cloud file browser.
Only story/test files retain the legacy token.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 23:07:00 +00:00
|
|
|
<div className="p-4 border-t border-border bg-kodo-ink flex justify-end gap-4">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Button variant="ghost" onClick={onClose}>
|
|
|
|
|
Cancel
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="primary"
|
2026-01-16 00:59:31 +00:00
|
|
|
className="bg-kodo-red hover:bg-kodo-red border-kodo-red text-white"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={() =>
|
|
|
|
|
onConfirm(
|
|
|
|
|
reason,
|
|
|
|
|
details,
|
|
|
|
|
isPermanent ? 'Permanent' : `${duration} days`,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Suspend User
|
|
|
|
|
</Button>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|