feat: categories — pages, nav, home block, admin editor select
This commit is contained in:
@@ -56,6 +56,9 @@ export default function Header() {
|
||||
{/* Desktop nav */}
|
||||
<nav className="hidden sm:flex items-center gap-1 text-sm">
|
||||
<Link href="/" className="btn btn-ghost text-sm py-1.5">Статьи</Link>
|
||||
<Link href="/category/cybersec" className="btn btn-ghost text-sm py-1.5">🔒 Безопасность</Link>
|
||||
<Link href="/category/automation" className="btn btn-ghost text-sm py-1.5">⚡ Автоматизация</Link>
|
||||
<Link href="/category/ai-dev" className="btn btn-ghost text-sm py-1.5">💻 Dev + AI</Link>
|
||||
<Link href="/archive" className="btn btn-ghost text-sm py-1.5">Архив</Link>
|
||||
<Link href="/notes" className="btn btn-ghost text-sm py-1.5">Заметки</Link>
|
||||
<Link href="/about" className="btn btn-ghost text-sm py-1.5">О проекте</Link>
|
||||
|
||||
@@ -13,6 +13,7 @@ export default function ArticleEditor({ article }) {
|
||||
const [content, setContent] = useState(article?.content || '');
|
||||
const [tags, setTags] = useState((article?.tags || []).join(', '));
|
||||
const [status, setStatus] = useState(article?.status || 'draft');
|
||||
const [category, setCategory] = useState(article?.category || 'ai-tools');
|
||||
const [seoTitle, setSeoTitle] = useState(article?.seo_title || '');
|
||||
const [seoDescr, setSeoDescr] = useState(article?.seo_descr || '');
|
||||
const [coverUrl, setCoverUrl] = useState(article?.cover_url || '');
|
||||
@@ -40,6 +41,7 @@ export default function ArticleEditor({ article }) {
|
||||
content: content.trim(),
|
||||
tags: tags.split(',').map(t => t.trim()).filter(Boolean),
|
||||
status,
|
||||
category,
|
||||
seo_title: seoTitle.trim() || null,
|
||||
seo_descr: seoDescr.trim() || null,
|
||||
cover_url: coverUrl.trim() || null,
|
||||
@@ -268,6 +270,19 @@ export default function ArticleEditor({ article }) {
|
||||
<option value="draft">Черновик</option>
|
||||
<option value="published">Опубликована</option>
|
||||
</select>
|
||||
<div>
|
||||
<label className="block text-xs font-medium text-neutral-500 mb-1">Категория</label>
|
||||
<select
|
||||
value={category}
|
||||
onChange={e => setCategory(e.target.value)}
|
||||
className="w-full px-3 py-2 rounded-lg border border-neutral-200 dark:border-neutral-700 bg-stone-50 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 text-sm focus:outline-none focus:ring-2 focus:ring-emerald-500"
|
||||
>
|
||||
<option value="ai-tools">🤖 ИИ-инструменты</option>
|
||||
<option value="cybersec">🔒 Кибербезопасность</option>
|
||||
<option value="automation">⚡ Автоматизация</option>
|
||||
<option value="ai-dev">💻 Разработка с ИИ</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-xs font-medium text-neutral-500 mb-1">Теги (через запятую)</label>
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user