"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>
  );
}
