Working with Events
Overview
Fetching Events
1. Using the useCommunityEvents Hook
"use client";
import { useCommunityEvents } from "@xborglabs/ui-shared/dist/client";
export function EventsContainer() {
const { data: events, status } = useCommunityEvents(clientEnv.NEXT_PUBLIC_COMMUNITY_ID);
if (status === "pending") {
return <p>Loading events...</p>;
}
if (status === "error") {
return <p>An error occurred...</p>;
}
return (
<div>
{events?.map((event) => (
<div key={event.eventId}>
<h3>{event.title}</h3>
<p>Event Type: {event.eventType}</p>
</div>
))}
</div>
);
}2. Using Headless Components
3. Using Base API Functions
Working with Event Data
Rendering Event Details
API Methods
Best Practices
Type Checking
Implementation Guidelines
Advanced Topics
1. Extending Event Types
2. Custom Hooks
3. Backend Integration
Last updated