mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
feat: add news section with admin editor and public article view
- NewsSection with animated grid background, category filters, featured cards - AdminNews list page with toggle publish/featured, pagination - AdminNewsCreate with TipTap rich text editor, URL validation - NewsArticle detail page with DOMPurify sanitization, Telegram back button - Toggle component with WCAG 44px touch targets, role=switch - Prose styles for highlight marks and responsive iframes - i18n translations (en, ru, zh, fa)
This commit is contained in:
59
src/types/news.ts
Normal file
59
src/types/news.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
export interface NewsArticle {
|
||||
id: number;
|
||||
title: string;
|
||||
slug: string;
|
||||
content: string;
|
||||
excerpt: string | null;
|
||||
category: string;
|
||||
category_color: string;
|
||||
tag: string | null;
|
||||
featured_image_url: string | null;
|
||||
is_published: boolean;
|
||||
is_featured: boolean;
|
||||
published_at: string | null;
|
||||
read_time_minutes: number;
|
||||
views_count: number;
|
||||
author_name?: string | null;
|
||||
created_at: string;
|
||||
updated_at: string | null;
|
||||
}
|
||||
|
||||
export interface NewsListItem {
|
||||
id: number;
|
||||
title: string;
|
||||
slug: string;
|
||||
excerpt: string | null;
|
||||
category: string;
|
||||
category_color: string;
|
||||
tag: string | null;
|
||||
featured_image_url: string | null;
|
||||
is_published: boolean;
|
||||
is_featured: boolean;
|
||||
published_at: string | null;
|
||||
read_time_minutes: number;
|
||||
views_count: number;
|
||||
}
|
||||
|
||||
export interface NewsListResponse {
|
||||
items: NewsListItem[];
|
||||
total: number;
|
||||
categories: string[];
|
||||
}
|
||||
|
||||
export interface NewsCreateRequest {
|
||||
title: string;
|
||||
slug: string;
|
||||
content: string;
|
||||
excerpt: string | null;
|
||||
category: string;
|
||||
category_color: string;
|
||||
tag: string | null;
|
||||
featured_image_url: string | null;
|
||||
is_published: boolean;
|
||||
is_featured: boolean;
|
||||
read_time_minutes: number;
|
||||
}
|
||||
|
||||
export interface NewsUpdateRequest extends Partial<NewsCreateRequest> {
|
||||
id?: never;
|
||||
}
|
||||
Reference in New Issue
Block a user