feat: Select article list in sight
This commit is contained in:
@@ -4,22 +4,6 @@ import { ReactMarkdownComponent, ReactMarkdownEditor } from "@widgets";
|
||||
import { Unlink, Trash2, ImagePlus } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
// Мокап данных для левой статьи
|
||||
const mockLeftArticle = {
|
||||
title: "История основания",
|
||||
markdownContent: `## Заголовок статьи H2
|
||||
|
||||
Какой-то **текст** для левой статьи.
|
||||
Можно использовать *markdown*.
|
||||
|
||||
- Список 1
|
||||
- Список 2
|
||||
|
||||
[Ссылка на Яндекс](https://ya.ru)
|
||||
`,
|
||||
media: null, // null или URL/ID медиа
|
||||
};
|
||||
|
||||
export const LeftWidgetTab = ({
|
||||
value,
|
||||
index,
|
||||
@@ -29,13 +13,9 @@ export const LeftWidgetTab = ({
|
||||
index: number;
|
||||
data?: Sight;
|
||||
}) => {
|
||||
const [articleTitle, setArticleTitle] = useState(mockLeftArticle.title);
|
||||
const [markdownContent, setMarkdownContent] = useState(
|
||||
mockLeftArticle.markdownContent
|
||||
);
|
||||
const [articleMedia, setArticleMedia] = useState<string | null>(
|
||||
mockLeftArticle.media
|
||||
); // Для превью медиа
|
||||
const [articleTitle, setArticleTitle] = useState("");
|
||||
const [markdownContent, setMarkdownContent] = useState("");
|
||||
const [articleMedia, setArticleMedia] = useState<string | null>(null); // Для превью медиа
|
||||
|
||||
const handleSelectMediaForArticle = () => {
|
||||
// Логика открытия модального окна для выбора медиа для статьи
|
||||
@@ -118,10 +98,6 @@ export const LeftWidgetTab = ({
|
||||
sx={{ width: "100%" }} // Примерная ширина как на макете
|
||||
/>
|
||||
|
||||
{/* Редактор Markdown */}
|
||||
<Typography variant="subtitle2" sx={{ mt: 1 }}>
|
||||
Текст
|
||||
</Typography>
|
||||
<ReactMarkdownEditor
|
||||
value={markdownContent}
|
||||
onChange={setMarkdownContent}
|
||||
@@ -157,7 +133,6 @@ export const LeftWidgetTab = ({
|
||||
borderRadius: 1,
|
||||
mb: 1,
|
||||
border: "2px dashed",
|
||||
borderColor: "grey.300",
|
||||
}}
|
||||
>
|
||||
<Typography color="text.secondary">Нет медиа</Typography>
|
||||
@@ -246,10 +221,8 @@ export const LeftWidgetTab = ({
|
||||
<Box
|
||||
sx={{
|
||||
padding: 2,
|
||||
backgroundColor: "#877361",
|
||||
|
||||
flexGrow: 1,
|
||||
color: "white",
|
||||
"& img": { maxWidth: "100%" },
|
||||
}}
|
||||
>
|
||||
<ReactMarkdownComponent value={markdownContent} />
|
||||
|
||||
Reference in New Issue
Block a user