Convert admin pages to new Tailwind design pattern
- Replace 'card' class with 'admin-card' (gradient cards, dark mode support) - Replace 'muted' class with consistent Tailwind muted states - Standardize page headers with gradient backgrounds and Lucide icons - Convert all inline styles to Tailwind classes - Add admin-page CSS helpers (admin-card, admin-filter-bar, admin-section-title) - Apply pattern to all 42 admin pages (was only 6 before) - Zero TypeScript errors, production builds successfully Co-authored-by: openhands <[email protected]>
This commit is contained in:
1 parent
b621ec79a3
commit
928544100b
46 files changed
+790
-635
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { Bell } from "lucide-react";
|
||||
import { sendHotelAlert } from "@/actions/admin-alerts";
|
||||
import { StatusCard } from "@/components/admin/dashboard";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
@@ -74,10 +75,15 @@ export default async function AdminAlerts() {
|
||||
|
||||
return (
|
||||
<main>
|
||||
<h1>Alerts</h1>
|
||||
<p className="muted" style={{ marginTop: "-0.4rem" }}>
|
||||
Read-only · 100 most recent alert_logs (newest first).
|
||||
</p>
|
||||
<div className="flex items-center gap-3 mb-6">
|
||||
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-[var(--color-primary)]/20 to-[var(--color-primary)]/5 grid place-items-center">
|
||||
<Bell size={20} className="text-[var(--color-primary)]" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">Alerts</h1>
|
||||
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">Read-only · 100 most recent alert_logs (newest first).</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3.5 mb-6">
|
||||
<StatusCard label="Alerts shown" value={alerts.length} icon="🔔" />
|
||||
@@ -101,19 +107,19 @@ export default async function AdminAlerts() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<form action={sendHotelAlert} className="card" style={{ marginBottom: "1.5rem" }}>
|
||||
<h3 style={{ marginTop: 0 }}>Send hotel alert</h3>
|
||||
<p className="muted" style={{ margin: "0 0 0.75rem" }}>
|
||||
<form action={sendHotelAlert} className="admin-card mb-6">
|
||||
<h3 className="mt-0">Send hotel alert</h3>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400">
|
||||
Broadcasts a message to every online user via RCON (<code>hotelalert</code>).
|
||||
</p>
|
||||
<div style={{ display: "flex", gap: "0.5rem", flexWrap: "wrap", alignItems: "flex-start" }}>
|
||||
<div className="flex gap-2 flex-wrap items-start">
|
||||
<textarea
|
||||
name="message"
|
||||
required
|
||||
maxLength={1000}
|
||||
rows={2}
|
||||
placeholder="Message to broadcast to the hotel…"
|
||||
style={{ flex: 1, minWidth: 240, resize: "vertical" }}
|
||||
className="flex-1 min-w-[240px]"
|
||||
/>
|
||||
<button type="submit" className="btn btn-primary">
|
||||
Send alert
|
||||
@@ -121,12 +127,12 @@ export default async function AdminAlerts() {
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<section className="card">
|
||||
<h3 style={{ marginTop: 0 }}>Recent alerts ({alerts.length})</h3>
|
||||
<section className="admin-card">
|
||||
<h3 className="mt-0">Recent alerts ({alerts.length})</h3>
|
||||
{alerts.length === 0 ? (
|
||||
<p className="muted">No alert logs.</p>
|
||||
<div className="admin-empty">No alert logs.</div>
|
||||
) : (
|
||||
<div style={{ overflowX: "auto" }}>
|
||||
<div className="overflow-x-auto">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -139,7 +145,7 @@ export default async function AdminAlerts() {
|
||||
<tbody>
|
||||
{alerts.map((a) => (
|
||||
<tr key={String(a.id)}>
|
||||
<td className="muted" style={{ whiteSpace: "nowrap" }}>
|
||||
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
|
||||
{fromDate(a.createdAt)}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in new issue
Block a user