fix(admin): persist data directory and pass env vars
This commit is contained in:
parent
99e8201745
commit
1d7e7c41c9
39 changed files with 1297 additions and 32 deletions
51
app/admin/reparaturanfragen/page.tsx
Normal file
51
app/admin/reparaturanfragen/page.tsx
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { redirect } from "next/navigation";
|
||||
import AdminShell from "@/components/admin/AdminShell";
|
||||
import StatusSelect from "@/components/admin/StatusSelect";
|
||||
import { requireAdminSession } from "@/lib/admin/auth";
|
||||
import { getRepairInquiries } from "@/lib/admin/store";
|
||||
|
||||
export default async function AdminRepairsPage() {
|
||||
if (!await requireAdminSession()) redirect("/admin/login");
|
||||
const inquiries = await getRepairInquiries();
|
||||
|
||||
return (
|
||||
<AdminShell>
|
||||
<div className="admin-page-head">
|
||||
<p className="eyebrow">Anfragen</p>
|
||||
<h1>Reparaturanfragen</h1>
|
||||
</div>
|
||||
<section className="admin-card">
|
||||
<table className="admin-table">
|
||||
<thead><tr><th>Datum</th><th>Name</th><th>Gerät</th><th>Hersteller</th><th>Modell</th><th>Status</th></tr></thead>
|
||||
<tbody>
|
||||
{inquiries.map((item) => (
|
||||
<tr key={item.id}>
|
||||
<td>{new Date(item.createdAt).toLocaleDateString("de-DE")}</td>
|
||||
<td>{item.name}</td>
|
||||
<td>{item.deviceType}</td>
|
||||
<td>{item.manufacturer}</td>
|
||||
<td>{item.model}</td>
|
||||
<td><StatusSelect id={item.id} type="repair" status={item.status} /></td>
|
||||
</tr>
|
||||
))}
|
||||
{inquiries.length === 0 && <tr><td colSpan={6}>Noch keine Reparaturanfragen vorhanden.</td></tr>}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section className="admin-card">
|
||||
<h2>Technische Details</h2>
|
||||
<div className="admin-detail-grid">
|
||||
{inquiries.slice(0, 6).map((item) => (
|
||||
<article key={item.id} className="admin-detail">
|
||||
<h3>{item.manufacturer} {item.model}</h3>
|
||||
<p><strong>Fehler:</strong> {item.description}</p>
|
||||
<p><strong>Zubehör:</strong> {item.accessories || "nicht angegeben"}</p>
|
||||
<p><strong>Vorarbeiten:</strong> {item.previousWork || "nicht angegeben"}</p>
|
||||
<button className="button light" type="button" disabled>In Olympus übernehmen</button>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</AdminShell>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue