Füge eine Benutzerverwaltung hinzu, damit "Manage Treatments" und "Manage Bookings" nur für den Shop Inhaber zugänglich ist.
This commit is contained in:
@@ -64,7 +64,7 @@ export function BookingForm() {
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!selectedTreatment || !customerName || !customerEmail || !customerPhone || !appointmentDate || !appointmentTime) {
|
||||
alert("Please fill in all required fields");
|
||||
alert("Bitte füllen Sie alle erforderlichen Felder aus");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export function BookingForm() {
|
||||
setAppointmentDate("");
|
||||
setAppointmentTime("");
|
||||
setNotes("");
|
||||
alert("Booking created successfully! We'll contact you to confirm your appointment.");
|
||||
alert("Buchung erfolgreich erstellt! Wir werden Sie kontaktieren, um Ihren Termin zu bestätigen.");
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -95,13 +95,13 @@ export function BookingForm() {
|
||||
|
||||
return (
|
||||
<div className="max-w-2xl mx-auto bg-white rounded-lg shadow-lg p-6">
|
||||
<h2 className="text-2xl font-bold text-gray-900 mb-6">Book Your Nail Treatment</h2>
|
||||
<h2 className="text-2xl font-bold text-gray-900 mb-6">Buchen Sie Ihre Nagelbehandlung</h2>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
{/* Treatment Selection */}
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Select Treatment *
|
||||
Behandlung auswählen *
|
||||
</label>
|
||||
<select
|
||||
value={selectedTreatment}
|
||||
@@ -109,7 +109,7 @@ export function BookingForm() {
|
||||
className="w-full p-3 border border-gray-300 rounded-md focus:ring-2 focus:ring-pink-500 focus:border-pink-500"
|
||||
required
|
||||
>
|
||||
<option value="">Choose a treatment</option>
|
||||
<option value="">Wählen Sie eine Behandlung</option>
|
||||
{treatments?.map((treatment) => (
|
||||
<option key={treatment.id} value={treatment.id}>
|
||||
{treatment.name} - ${(treatment.price / 100).toFixed(2)} ({treatment.duration} min)
|
||||
@@ -125,7 +125,7 @@ export function BookingForm() {
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Full Name *
|
||||
Vollständiger Name *
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
@@ -137,7 +137,7 @@ export function BookingForm() {
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Email *
|
||||
E-Mail *
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
@@ -151,7 +151,7 @@ export function BookingForm() {
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Phone Number *
|
||||
Telefonnummer *
|
||||
</label>
|
||||
<input
|
||||
type="tel"
|
||||
@@ -166,7 +166,7 @@ export function BookingForm() {
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Preferred Date *
|
||||
Gewünschtes Datum *
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
@@ -179,7 +179,7 @@ export function BookingForm() {
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Preferred Time *
|
||||
Gewünschte Uhrzeit *
|
||||
</label>
|
||||
<select
|
||||
value={appointmentTime}
|
||||
@@ -188,7 +188,7 @@ export function BookingForm() {
|
||||
disabled={!appointmentDate || !selectedTreatment}
|
||||
required
|
||||
>
|
||||
<option value="">Select time</option>
|
||||
<option value="">Zeit auswählen</option>
|
||||
{availableTimeSlots.map((time) => (
|
||||
<option key={time} value={time}>
|
||||
{time}
|
||||
@@ -201,14 +201,14 @@ export function BookingForm() {
|
||||
{/* Notes */}
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Additional Notes
|
||||
Zusätzliche Notizen
|
||||
</label>
|
||||
<textarea
|
||||
value={notes}
|
||||
onChange={(e) => setNotes(e.target.value)}
|
||||
rows={3}
|
||||
className="w-full p-3 border border-gray-300 rounded-md focus:ring-2 focus:ring-pink-500 focus:border-pink-500"
|
||||
placeholder="Any special requests or information..."
|
||||
placeholder="Besondere Wünsche oder Informationen..."
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -217,7 +217,7 @@ export function BookingForm() {
|
||||
disabled={isPending}
|
||||
className="w-full bg-pink-600 text-white py-3 px-4 rounded-md hover:bg-pink-700 focus:ring-2 focus:ring-pink-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed font-medium"
|
||||
>
|
||||
{isPending ? "Booking..." : "Book Appointment"}
|
||||
{isPending ? "Wird gebucht..." : "Termin buchen"}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user