UNPKG

wix-style-react

Version:
20 lines 1.43 kB
import React from 'react'; import { dataHooks, PUBLISH_DATE_JUST_NOW } from '../constants'; import { classes } from './InstagramPost.st.css'; import { Avatar, Text } from '../..'; export const InstagramPost = ({ profileName, profileImageSrc, caption, media }) => { const _renderAccountDetails = () => (React.createElement("div", { className: classes.postHeader }, React.createElement(Avatar, { size: "size24", imgProps: { src: profileImageSrc }, dataHook: dataHooks.socialPostPreviewProfileImage }), React.createElement(Text, { size: "tiny", weight: "normal", dataHook: dataHooks.socialPostPreviewProfileName }, profileName))); const _renderMedia = () => (React.createElement("div", { "data-hook": dataHooks.socialPostPreviewMedia }, media)); const _renderCaptionAndPublishDate = () => (React.createElement("div", { className: classes.postCaption }, caption && (React.createElement(React.Fragment, null, React.createElement(Text, { size: "tiny", weight: "bold" }, profileName), React.createElement(Text, { dataHook: dataHooks.socialPostPreviewCaption, size: "tiny" }, caption))), React.createElement(Text, { skin: "disabled", size: "tiny" }, PUBLISH_DATE_JUST_NOW))); return (React.createElement(React.Fragment, null, _renderAccountDetails(), _renderMedia(), _renderCaptionAndPublishDate())); }; //# sourceMappingURL=InstagramPost.js.map