mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:09:46 +00:00
WpPost: переименовал, убрал isLab из пропсов
This commit is contained in:
1 parent
49a2a764b2
commit
6bf64c23bf
1 file changed
+34
@@ -0,0 +1,34 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
import MediaBlock from "@/widgets/MediaBlock/MediaBlock";
|
||||
|
||||
import { PageContent, PageHeader } from "@/widgets/WpPost";
|
||||
import { App } from "@/shared/types/app";
|
||||
|
||||
interface WpPostProps {
|
||||
post: App.WpPost;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export default function WpPost({
|
||||
post,
|
||||
children,
|
||||
}: WpPostProps) {
|
||||
return (
|
||||
<>
|
||||
<PageHeader className="header">
|
||||
<h1>{post.title}</h1>
|
||||
</PageHeader>
|
||||
<PageContent className="content">
|
||||
{Array.isArray(post.content) &&
|
||||
post.content.map((el, index) => {
|
||||
if (el.type === "mediablock") {
|
||||
return <MediaBlock key={index} images={el.value} />;
|
||||
}
|
||||
return <div key={index}>{el.element}</div>;
|
||||
})}
|
||||
{children}
|
||||
</PageContent>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user