Initial commit of Dance School App

This commit is contained in:
kertenkerem
2026-01-08 00:51:13 +03:00
parent 902fb6e9bb
commit 260dea0713
48 changed files with 7923 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
'use client';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import styles from '../branches/branches.module.css'; // Reuse styles
export function AddInstructorForm() {
const [name, setName] = useState('');
const [bio, setBio] = useState('');
const router = useRouter();
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
await fetch('/api/instructors', {
method: 'POST',
body: JSON.stringify({ name, bio }),
});
setName('');
setBio('');
router.refresh();
};
return (
<form onSubmit={handleSubmit} className={styles.form}>
<div className={styles.inputGroup}>
<label>Hoca Adı</label>
<input value={name} onChange={e => setName(e.target.value)} className={styles.input} required />
</div>
<div className={styles.inputGroup}>
<label>Biyografi / Uzmanlık</label>
<input value={bio} onChange={e => setBio(e.target.value)} className={styles.input} />
</div>
<button type="submit" className={styles.btn}>Ekle</button>
</form>
);
}