diff --git a/src/features/edit/edit-content/edit-content.component.tsx b/src/features/edit/edit-content/edit-content.component.tsx index 438c55b4..23dd92d1 100644 --- a/src/features/edit/edit-content/edit-content.component.tsx +++ b/src/features/edit/edit-content/edit-content.component.tsx @@ -1,17 +1,19 @@ 'use client'; -import * as React from 'react'; +import Link from 'next/link'; import { FC } from 'react'; +import MaterialSymbolsArrowRightAltRounded from '~icons/material-symbols/arrow-right-alt-rounded'; +import H3 from '@/components/typography/h3'; import Block from '@/components/ui/block'; -import Header from '@/components/ui/header'; +import { Button } from '@/components/ui/button'; import Details from '@/features/edit/edit-content/details'; -import General from '@/features/edit/edit-content/general'; -import { getTitle } from '@/utils/adapters/convert-title'; import { CONTENT_TYPE_LINKS } from '@/utils/constants/navigation'; +import General from './general'; + interface Props { slug: string; content_type: API.ContentType; @@ -19,26 +21,38 @@ interface Props { } const EditContent: FC = ({ slug, content_type, content }) => { - const [type, setType] = React.useState<'general' | 'details'>('details'); - if (!content) { return null; } const link = `${CONTENT_TYPE_LINKS[content_type]}/${slug}`; - const image = content.data_type === 'anime' ? content.image : content.image; - const title = getTitle({ data: content, titleLanguage: 'title_ua' }); - return ( -
-
- +
+
+ +

Контент

+ +
+ +
+
+ +
+
); }; diff --git a/src/features/edit/edit-content/general.tsx b/src/features/edit/edit-content/general.tsx index f8aef521..99047108 100644 --- a/src/features/edit/edit-content/general.tsx +++ b/src/features/edit/edit-content/general.tsx @@ -1,26 +1,49 @@ -import { FC } from 'react'; +import { FC, PropsWithChildren } from 'react'; +import MaterialSymbolsCalendarClockRounded from '~icons/material-symbols/calendar-clock-rounded'; +import MaterialSymbolsCategoryOutlineRounded from '~icons/material-symbols/category-outline-rounded'; -import ContentCard from '@/components/content-card/content-card'; -import { Label } from '@/components/ui/label'; +import Card from '@/components/ui/card'; +import HorizontalCard from '@/components/ui/horizontal-card'; -interface Props { - image: string; - title: string; +import { CONTENT_TYPES } from '@/utils/constants/common'; +import { CONTENT_TYPE_LINKS } from '@/utils/constants/navigation'; + +interface Props extends PropsWithChildren { + content: API.MainContent; + content_type: API.ContentType; + slug: string; } -const General: FC = ({ title, image }) => { +const General: FC = ({ content, content_type, slug }) => { + const image = content.data_type === 'anime' ? content.image : content.image; + const link = `${CONTENT_TYPE_LINKS[content_type]}/${slug}`; + return ( - <> -
- -
-
-
- -
- -
- + + + + {CONTENT_TYPES[content_type].title_ua} + + } + meta={ + (content.data_type === 'anime' || + content.data_type === 'manga' || + content.data_type === 'novel') && ( +
+ + {content.year} +
+ ) + } + href={link || '#'} + /> +
); };