-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: página de todas as pessoas com conta
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import RainbowIcon from '@/components/icons/RainbowIcon' | ||
import ProfilesGrid from '@/components/ProfilesGrid' | ||
import SectionTitle from '@/components/SectionTitle' | ||
import { Text } from '@/components/ui/text' | ||
import { auth, client } from '@/edgedb' | ||
import { peopleIndexQuery } from '@/queries' | ||
import { buildTraceAndMetrics, runServerEffect } from '@/services/runtime' | ||
import { Effect, pipe } from 'effect' | ||
import { notFound } from 'next/navigation' | ||
|
||
export default async function PeopleIndexRoute() { | ||
const session = await auth.getSession() | ||
if (!(await session.isSignedIn())) { | ||
return notFound() | ||
} | ||
|
||
const data = await runServerEffect( | ||
pipe( | ||
Effect.tryPromise({ | ||
try: () => peopleIndexQuery.run(client), | ||
catch: (error) => console.log(error), | ||
}), | ||
...buildTraceAndMetrics('people_index'), | ||
Effect.catchAll(() => Effect.succeed(null)), | ||
), | ||
) | ||
|
||
if (!data?.length) { | ||
return null | ||
} | ||
|
||
return ( | ||
<section className="mb-32 mt-12"> | ||
<SectionTitle Icon={RainbowIcon}>Quem se envolve</SectionTitle> | ||
<Text level="h3" className="px-pageX font-normal"> | ||
Cultivando sabedoria e compartilhando experiências para agroecologizar o | ||
mundo ✨ | ||
</Text> | ||
<ProfilesGrid profiles={data} className="mt-8 px-pageX" /> | ||
</section> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters