Files
chronus/src/pages/dashboard/clients/new.astro

117 lines
3.4 KiB
Plaintext

---
import DashboardLayout from '../../../layouts/DashboardLayout.astro';
const user = Astro.locals.user;
if (!user) return Astro.redirect('/login');
---
<DashboardLayout title="New Client - Chronus">
<div class="max-w-2xl mx-auto">
<h1 class="text-2xl font-extrabold tracking-tight mb-6">Add New Client</h1>
<form method="POST" action="/api/clients/create" class="card card-border bg-base-100">
<div class="card-body p-4">
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">Client Name</legend>
<input
type="text"
id="name"
name="name"
placeholder="Acme Corp"
class="input w-full"
required
/>
</fieldset>
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">Email (optional)</legend>
<input
type="email"
id="email"
name="email"
placeholder="jason.borne@cia.com"
class="input w-full"
/>
</fieldset>
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">Phone (optional)</legend>
<input
type="tel"
id="phone"
name="phone"
placeholder="+1 (780) 420-1337"
class="input w-full"
/>
</fieldset>
<div class="divider text-xs text-base-content/60">Address Details</div>
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">Street Address (optional)</legend>
<input
type="text"
id="street"
name="street"
placeholder="123 Business Rd"
class="input w-full"
/>
</fieldset>
<div class="grid grid-cols-1 md:grid-cols-2 gap-3">
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">City (optional)</legend>
<input
type="text"
id="city"
name="city"
placeholder="Edmonton"
class="input w-full"
/>
</fieldset>
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">State / Province (optional)</legend>
<input
type="text"
id="state"
name="state"
placeholder="AB"
class="input w-full"
/>
</fieldset>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-3">
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">Zip / Postal Code (optional)</legend>
<input
type="text"
id="zip"
name="zip"
placeholder="10001"
class="input w-full"
/>
</fieldset>
<fieldset class="fieldset">
<legend class="fieldset-legend text-xs">Country (optional)</legend>
<input
type="text"
id="country"
name="country"
placeholder="Canada"
class="input w-full"
/>
</fieldset>
</div>
<div class="flex justify-end gap-2 mt-4">
<a href="/dashboard/clients" class="btn btn-ghost btn-sm">Cancel</a>
<button type="submit" class="btn btn-primary btn-sm">Create Client</button>
</div>
</div>
</form>
</div>
</DashboardLayout>