Complete admin panel for content management: - SQLite database with better-sqlite3, seed script from content.ts - Simple password auth with HMAC-signed cookies (Edge + Node compatible) - 9 section editors: meta, hero, about, team, classes, schedule, pricing, FAQ, contact - Team CRUD with image upload and drag reorder - Schedule editor with Google Calendar-style visual timeline (colored blocks, overlap detection, click-to-add) - All public components refactored to accept data props from DB (with fallback to static content) - Middleware protecting /admin/* and /api/admin/* routes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import { SectionEditor } from "../_components/SectionEditor";
|
|
import { InputField } from "../_components/FormField";
|
|
|
|
interface HeroData {
|
|
headline: string;
|
|
subheadline: string;
|
|
ctaText: string;
|
|
ctaHref: string;
|
|
}
|
|
|
|
export default function HeroEditorPage() {
|
|
return (
|
|
<SectionEditor<HeroData> sectionKey="hero" title="Главный экран">
|
|
{(data, update) => (
|
|
<>
|
|
<InputField
|
|
label="Заголовок"
|
|
value={data.headline}
|
|
onChange={(v) => update({ ...data, headline: v })}
|
|
/>
|
|
<InputField
|
|
label="Подзаголовок"
|
|
value={data.subheadline}
|
|
onChange={(v) => update({ ...data, subheadline: v })}
|
|
/>
|
|
<InputField
|
|
label="Текст кнопки"
|
|
value={data.ctaText}
|
|
onChange={(v) => update({ ...data, ctaText: v })}
|
|
/>
|
|
<InputField
|
|
label="Ссылка кнопки"
|
|
value={data.ctaHref}
|
|
onChange={(v) => update({ ...data, ctaHref: v })}
|
|
type="url"
|
|
/>
|
|
</>
|
|
)}
|
|
</SectionEditor>
|
|
);
|
|
}
|