MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / getAnalyticsServerSideProps

Function getAnalyticsServerSideProps

pages/analytics.tsx:282–313  ·  view source on GitHub ↗
(
  ctx: GetServerSidePropsContext,
)

Source from the content-addressed store, hash-verified

280
281export const getServerSideProps = getAnalyticsServerSideProps;
282export async function getAnalyticsServerSideProps(
283 ctx: GetServerSidePropsContext,
284) {
285 const signInProps = await pageGetServerSideProps(ctx);
286 if (signInProps.redirect) return signInProps;
287
288 const supabase = createServerSupabaseClient(ctx);
289 const onChange = () => {};
290 const checked = true;
291 const conversations = await getConversations(
292 0,
293 PAGESIZE,
294 // TODO: Grab from URL if set
295 [
296 { id: "1", name: "No Feedback", checked, onChange },
297 { id: "2", name: "Positive Feedback", checked, onChange },
298 { id: "3", name: "Negative Feedback", checked, onChange },
299 ],
300 [
301 { id: "1", name: "From Playground", checked, onChange },
302 { id: "2", name: "From API", checked, onChange },
303 ],
304 supabase,
305 );
306 return {
307 props: {
308 ...signInProps.props,
309 conversations,
310 conversationId: ctx.query.id ?? null,
311 },
312 };
313}

Callers

nothing calls this directly

Calls 2

pageGetServerSidePropsFunction · 0.90
getConversationsFunction · 0.90

Tested by

no test coverage detected