diff --git a/client/src/app/meetings/MyMeetingsPage.tsx b/client/src/app/meetings/MyMeetingsPage.tsx new file mode 100644 index 0000000..abfe77f --- /dev/null +++ b/client/src/app/meetings/MyMeetingsPage.tsx @@ -0,0 +1,34 @@ +'use client' + +import { useUser } from '@clerk/nextjs' +import { Call, useStreamVideoClient } from '@stream-io/video-react-sdk' +import { useEffect, useState } from 'react' + +const MyMeetingsPage = () => { + const { user } = useUser() + const client = useStreamVideoClient() + const [call, setCalls] = useState() + useEffect(() => { + async function loadCalls() { + if (!client || !user?.id) { + return + } + const { calls } = await client.queryCalls({ + sort: [{ field: 'starts_at', direction: -1 }], + filter_conditions: { + starts_at: { $exists: true }, + $or: [{ created_by_user_id: user.id }, { members: { $in: [user.id] } }] + } + }) + setCalls(calls) + } + loadCalls() + }, [client, user?.id]) + return ( +
+

My Meetings

+
+ ) +} + +export default MyMeetingsPage diff --git a/client/src/app/meetings/page.tsx b/client/src/app/meetings/page.tsx new file mode 100644 index 0000000..77a80c8 --- /dev/null +++ b/client/src/app/meetings/page.tsx @@ -0,0 +1,12 @@ +import { Metadata } from 'next' +import MyMeetingsPage from './MyMeetingsPage' + +export const metadata: Metadata = { + title: 'My Meetings' +} + +const page = () => { + return +} + +export default page diff --git a/client/src/components/Navbar.tsx b/client/src/components/Navbar.tsx index 88458e0..d2fe429 100644 --- a/client/src/components/Navbar.tsx +++ b/client/src/components/Navbar.tsx @@ -8,7 +8,7 @@ const Navbar = () => { New Meeting
- Meeting + Meetings