import { CSSProperties, FC, useId } from 'react'; import JSXStyle from 'styled-jsx/style'; export type TSectionImage = { url: string; type: 'image'; size: string; position: string; offsetX: number | null; opacity?: number; tileSize?: number; }; interface Props { media: TSectionImage; sectionId: string; } export const SectionImage: FC = ({ media, sectionId }) => { const { url, size, position, offsetX, opacity, tileSize } = media; const isContainHeight = size === 'contain-height'; const isTile = size === 'tile'; const hasOffsetX = offsetX !== null && size === 'contain'; return ( <>
{isTile ? (
) : ( )}
); };