55 lines
1.8 KiB
TypeScript
55 lines
1.8 KiB
TypeScript
import Link from "next/link";
|
|
import { createCourseAction } from "@/app/admin/courses/actions";
|
|
|
|
export default function AdminNewCoursePage() {
|
|
return (
|
|
<div>
|
|
<p className="muted">
|
|
<Link href="/admin/courses">← Zurück</Link>
|
|
</p>
|
|
<h1 className="page-title">Neuer Kurs</h1>
|
|
<p className="muted subtitle">Nach dem Anlegen kannst du Module und Lektionen hinzufügen.</p>
|
|
|
|
<form action={createCourseAction} className="panel form">
|
|
<label>
|
|
Titel
|
|
<input name="title" required />
|
|
</label>
|
|
<label>
|
|
Slug (optional, sonst aus Titel)
|
|
<input name="slug" placeholder="z.b. modul-3-sicherheit" />
|
|
</label>
|
|
<label>
|
|
Kurzbeschreibung
|
|
<textarea name="description" />
|
|
</label>
|
|
<label>
|
|
Anzeige-Autor
|
|
<input name="authorName" placeholder="z.B. MatzeFix" />
|
|
</label>
|
|
<label>
|
|
Preis (EUR, 0 = kostenlos)
|
|
<input name="priceEuros" type="number" step="0.01" min="0" defaultValue="0" />
|
|
</label>
|
|
<label>
|
|
Abrechnungsintervall
|
|
<select name="billingInterval" defaultValue="NONE">
|
|
<option value="NONE">Einmal / kein Abo</option>
|
|
<option value="MONTH">Monatlich</option>
|
|
<option value="QUARTER">Vierteljährlich</option>
|
|
<option value="YEAR">Jährlich</option>
|
|
</select>
|
|
</label>
|
|
<label className="stack" style={{ alignItems: "center" }}>
|
|
<span style={{ display: "flex", gap: "0.5rem", alignItems: "center" }}>
|
|
<input type="checkbox" name="published" /> Veröffentlicht
|
|
</span>
|
|
</label>
|
|
<button type="submit" className="btn btn-primary">
|
|
Kurs anlegen
|
|
</button>
|
|
</form>
|
|
</div>
|
|
);
|
|
}
|