diff --git a/src/webapp/app/(authenticated)/collections/create/page.tsx b/src/webapp/app/(authenticated)/collections/create/page.tsx deleted file mode 100644 index ee0dbd35..00000000 --- a/src/webapp/app/(authenticated)/collections/create/page.tsx +++ /dev/null @@ -1,133 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import { useRouter } from 'next/navigation'; -import { getAccessToken } from '@/services/auth'; -import { ApiClient } from '@/api-client/ApiClient'; -import { - Stack, - Title, - Text, - Container, - Card, - Button, - TextInput, - Textarea, - Group, - Alert, -} from '@mantine/core'; -import { useForm } from '@mantine/form'; - -export default function CreateCollectionPage() { - const form = useForm({ - initialValues: { - name: '', - description: '', - }, - }); - - const [loading, setLoading] = useState(false); - const [error, setError] = useState(''); - const router = useRouter(); - - // Create API client instance - const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', - () => getAccessToken(), - ); - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - - if (!form.getValues().name.trim()) { - setError('Collection name is required'); - return; - } - - setLoading(true); - setError(''); - - try { - await apiClient.createCollection({ - name: form.getValues().name.trim(), - description: form.getValues().description.trim() || undefined, - }); - - // Redirect to collections page on success - router.push('/collections'); - } catch (error: any) { - console.error('Error creating collection:', error); - setError( - error.message || 'Failed to create collection. Please try again.', - ); - } finally { - setLoading(false); - } - }; - - return ( - - - - Create Collection - - Create a new collection to organize your cards. - - - - - - Collection Details - - -
- - - - -