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,6 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { StatusCard } from '@/components/admin/dashboard';
|
||||
import { Clock } from 'lucide-react';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
@@ -74,7 +75,7 @@ export default async function AdminRadioHistoryPage() {
|
||||
|
||||
return (
|
||||
<main>
|
||||
<nav className="muted" style={{ marginBottom: '0.5rem' }}>
|
||||
<nav className="text-xs text-gray-500 dark:text-gray-400 mb-2">
|
||||
<Link href="/admin/radio">Radio</Link> ·{' '}
|
||||
<Link href="/admin/radio/settings">Settings</Link> ·{' '}
|
||||
<Link href="/admin/radio/banners">Banners</Link> ·{' '}
|
||||
@@ -82,15 +83,19 @@ export default async function AdminRadioHistoryPage() {
|
||||
<Link href="/admin/radio/history">History</Link>
|
||||
</nav>
|
||||
|
||||
<h1>Radio Play History</h1>
|
||||
<p className="muted" style={{ marginTop: '-0.4rem' }}>
|
||||
Past DJ shows and airtime (<code>radio_history</code>), most recent first.
|
||||
Read-only log of who was on air, when, and how many listeners tuned in.
|
||||
</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">
|
||||
<Clock size={20} className="text-[var(--color-primary)]" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">Radio Play History</h1>
|
||||
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">Past DJ shows and airtime (<code>radio_history</code>), most recent first. Read-only log of who was on air, when, and how many listeners tuned in.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{dbError ? (
|
||||
<div className="card" style={{ marginBottom: '1.5rem' }}>
|
||||
<p className="muted" style={{ margin: 0 }}>
|
||||
<div className="admin-card mb-6">
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400 m-0">
|
||||
Could not load radio history (database unavailable).
|
||||
</p>
|
||||
</div>
|
||||
@@ -109,12 +114,12 @@ export default async function AdminRadioHistoryPage() {
|
||||
)}
|
||||
|
||||
{!dbError && history.length === 0 ? (
|
||||
<p className="muted">No radio history recorded yet.</p>
|
||||
<div className="admin-empty">No radio history recorded yet.</div>
|
||||
) : null}
|
||||
|
||||
{history.length > 0 ? (
|
||||
<section className="mt-6">
|
||||
<h2>Show log ({history.length})</h2>
|
||||
<h2 className="admin-section-title">Show log ({history.length})</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -134,17 +139,17 @@ export default async function AdminRadioHistoryPage() {
|
||||
<td>{String(h.id)}</td>
|
||||
<td>{names.get(String(h.userId)) ?? `#${String(h.userId)}`}</td>
|
||||
<td>{h.showName ?? '—'}</td>
|
||||
<td className="muted">{formatDate(h.startedAt)}</td>
|
||||
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{formatDate(h.startedAt)}</td>
|
||||
<td>
|
||||
{h.endedAt ? (
|
||||
<span className="muted">{formatDate(h.endedAt)}</span>
|
||||
<span className="text-sm text-gray-500 dark:text-gray-400">{formatDate(h.endedAt)}</span>
|
||||
) : (
|
||||
<span className="inline-block text-[0.72rem] font-bold px-2 py-0.5 rounded-full bg-green-600/20 text-[var(--color-text)]">on air</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="muted">{formatDuration(h.startedAt, h.endedAt)}</td>
|
||||
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{formatDuration(h.startedAt, h.endedAt)}</td>
|
||||
<td>{h.listenersCount}</td>
|
||||
<td className="muted">{h.notes ?? '—'}</td>
|
||||
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{h.notes ?? '—'}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
Reference in new issue
Block a user