From 9608610b0fef717c8f2d87ab518a077f4e0763cb Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 9 Nov 2025 20:33:00 -0800 Subject: admin: implement user deletion --- frontend/src/components/InviteCodeManager.tsx | 128 -------------------------- 1 file changed, 128 deletions(-) delete mode 100644 frontend/src/components/InviteCodeManager.tsx (limited to 'frontend/src/components/InviteCodeManager.tsx') diff --git a/frontend/src/components/InviteCodeManager.tsx b/frontend/src/components/InviteCodeManager.tsx deleted file mode 100644 index a281366..0000000 --- a/frontend/src/components/InviteCodeManager.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import { useState } from 'react'; - -interface InviteFormData { - uses: string; - code: string; -} - -interface InviteCodeManagerProps { - onInviteSubmit: (formData: InviteFormData) => Promise; - isCreatingInvite: boolean; - createdInviteCode: string | null; -} - -const InviteCodeManager = ({ onInviteSubmit, isCreatingInvite, createdInviteCode }: InviteCodeManagerProps) => { - const [inviteFormData, setInviteFormData] = useState({ - uses: '', - code: '' - }); - - const handleInviteInputChange = (e: React.ChangeEvent) => { - const { name, value } = e.target; - setInviteFormData(prev => ({ - ...prev, - [name]: value - })); - }; - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - - if (!inviteFormData.uses) { - alert('Please specify the number of uses for the invite code'); - return; - } - - const uses = parseInt(inviteFormData.uses); - if (isNaN(uses) || uses <= 0) { - alert('Please enter a valid number of uses'); - return; - } - - await onInviteSubmit(inviteFormData); - - // Reset form after successful submission - setInviteFormData({ - uses: '', - code: '' - }); - }; - - const copyToClipboard = (text: string) => { - navigator.clipboard.writeText(text).then(() => { - alert('Invite code copied to clipboard!'); - }).catch(() => { - alert('Failed to copy to clipboard'); - }); - }; - - return ( - <> -

- Generate invite codes to allow new users to register. You can specify how many times the code can be used - and optionally set a custom code (otherwise one will be generated automatically). -

- - {createdInviteCode && ( -
-

Invite Code Created Successfully!

-
- - {createdInviteCode} - - -
-
- )} - -
-
- - -
-
- - -
-
- -
-
- - ); -}; - -export default InviteCodeManager; \ No newline at end of file -- cgit v1.2.3