yogastic/yoga-app/src/components/block.with.image.component.tsx
2025-09-10 22:38:04 +02:00

36 lines
1.4 KiB
TypeScript

import {ButtonConfig, ImageConfig} from "@/types/types";
import {BlocksContent} from "@strapi/blocks-react-renderer";
import BlockWithRightImage from "@/components/block.with.right.image.component";
import BlockWithLeftImage from "@/components/block.with.left.image.component";
export interface BlockWithImageComponentProps {
id?: string;
title?: string;
header?: string;
block: BlocksContent;
image: ImageConfig;
button?: ButtonConfig;
}
export default function BlockWithImageComponent({
block,
image,
id,
title,
header,
button
}: BlockWithImageComponentProps) {
return (
<>
{image?.position == 'Right' && <BlockWithRightImage
block={block} image={image} id={id} title={title}
header={header}
button={button}/>}
{image?.position == 'Left' && <BlockWithLeftImage block={block} image={image} id={id} title={title}
header={header}
button={button}/>}
</>
);
}