diff --git a/client/src/components/IgMetaBlock.tsx b/client/src/components/IgMetaBlock.tsx new file mode 100644 index 0000000..c0313af --- /dev/null +++ b/client/src/components/IgMetaBlock.tsx @@ -0,0 +1,47 @@ +import ExpandableText from './ExpandableText'; +import type { InstagramMeta } from '../types'; + +interface Props { + ig: InstagramMeta; + entryId?: string; +} + +export default function IgMetaBlock({ ig, entryId }: Props) { + const profileUrl = ig.profile_url || (ig.username ? `https://www.instagram.com/${ig.username}/` : undefined); + const postDate = ig.post_date; + return ( +
+ {ig.profile_pic_url ? ( + + {ig.username { + if (ig.profile_pic_url && !e.currentTarget.dataset.fallback) { + e.currentTarget.dataset.fallback = '1'; + e.currentTarget.src = ig.profile_pic_url; + } + }} + /> + + ) : ( +
+ )} +
+
+ {ig.username ? ( + + {ig.username} + + ) : ( + Instagram + )} + {ig.full_name && ยท {ig.full_name}} +
+
{postDate || 'Date unknown'}
+ {ig.description && } +
+
+ ); +}