mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 23:59:08 +03:00
Allow docs to build locally for contributors without secrets by guarding the partners DB query behind an IS_PLATFORM check.
32 lines
879 B
TypeScript
32 lines
879 B
TypeScript
import { type PropsWithChildren } from 'react'
|
|
|
|
import { IS_PLATFORM } from 'common'
|
|
|
|
import { supabaseMisc } from '~/lib/supabaseMisc'
|
|
import Layout from '~/layouts/guides'
|
|
|
|
const GuidesLayout = async ({ children }: PropsWithChildren) => {
|
|
const partners = IS_PLATFORM ? await getPartners() : []
|
|
const partnerNavItems = partners.map((partner) => ({
|
|
name: partner.title,
|
|
url: `https://supabase.com/partners/integrations/${partner.slug}` as `https://${string}`,
|
|
}))
|
|
|
|
return <Layout additionalNavItems={partnerNavItems}>{children}</Layout>
|
|
}
|
|
|
|
async function getPartners() {
|
|
const { data, error } = await supabaseMisc()
|
|
.from('partners')
|
|
.select('slug, title')
|
|
.eq('type', 'technology')
|
|
.order('title')
|
|
if (error) {
|
|
console.error(new Error('Error fetching partners', { cause: error }))
|
|
}
|
|
|
|
return data ?? []
|
|
}
|
|
|
|
export default GuidesLayout
|