// Generated with util/create-component.js import React from "react"; import NsImage from "../shared/ns-image"; import Heading from "../UI/Heading"; import Text from "../UI/Text"; import { ExhibitionProps } from "./Exhibition.types"; const Exhibition: React.FC = (props) => { const { data, fluid } = props; const { title, startAt, endAt, imageUrl, ImageWrapper } = data; const getFormatDate = (date: string) => { if (!date) return ""; return date.substring(0, 10).replace(/-/g, "."); }; const exhibitionDuration = `${getFormatDate(startAt)}~${getFormatDate( endAt )}`; const imageSize = fluid ? "w-full max-w-[32.5rem] pc:max-w-[56rem]" : "w-[32.5rem] pc:w-[56rem]"; return (
{title} {exhibitionDuration}
); }; export default Exhibition;