diff --git a/src/components/EventPost/index.tsx b/src/components/EventPost/index.tsx index d127fc3c..45384031 100644 --- a/src/components/EventPost/index.tsx +++ b/src/components/EventPost/index.tsx @@ -8,7 +8,7 @@ type Props = { title?: string; }; -const YouTubeEmbed = ({ id}) => { +const YouTubeEmbed = ({ id }) => { if (!id) return null; const embedUrl = `https://www.youtube.com/embed/${id}`; @@ -28,15 +28,33 @@ const YouTubeEmbed = ({ id}) => { ); }; -const EventPosts: React.FC = ({ post }) => { +const EventPosts: React.FC = ({ + post, +}) => { + // Determine the agenda path based on location or speaker type flags + const getAgendaPath = () => { + // First, try to detect from current URL + if (typeof window !== 'undefined') { + const currentPath = window.location.pathname; + if (currentPath.includes('/virtual/')) return "/2025/virtual/agenda"; + if (currentPath.includes('/boston/')) return "/2025/boston/agenda"; + if (currentPath.includes('/barcelona/')) return "/2025/barcelona/agenda"; + } + + // Default fallback + return "/2025/boston/agenda"; + }; + + const agendaPath = getAgendaPath(); return (
- {/*

{post?.publishedAt}

*/} - {post?.category} -

{post?.title}

+ {post?.category && ( +

{post.category}

+ )} +

{post?.title}

@@ -47,17 +65,18 @@ const EventPosts: React.FC = ({ post }) => { ))}
-
{post.associatedPerson.name}
- {post.coauthors &&
Coauthors: {post.coauthors}
} + {post.coauthors && ( +
Coauthors: {post.coauthors}
+ )}
-

{post?.category}

+ {post.projectLink && (
)} - - {post?.category}
{post.youtube && ( -
+
- +
)} - {post.poster?.asset.url && ( -
+ {post.poster?.asset?.url && ( +