mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 10:25:06 +03:00
## Problem Knip reports many duplicate exports (both named and default). Besides, we're moving away from default exports and even have an eslint rule to enforce it on new code. ## Solution - Cleanup those exports - Update imports when necessary No functional changes. If it builds, it's fine
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { useParams } from 'next/navigation'
|
|
import { useRouter } from 'next/router'
|
|
import { useEffect } from 'react'
|
|
|
|
import SQLExamples from '@/components/interfaces/SQLEditor/SQLTemplates/SQLExamples'
|
|
import { DefaultLayout } from '@/components/layouts/DefaultLayout'
|
|
import { EditorBaseLayout } from '@/components/layouts/editors/EditorBaseLayout'
|
|
import SQLEditorLayout from '@/components/layouts/SQLEditorLayout/SQLEditorLayout'
|
|
import { SQLEditorMenu } from '@/components/layouts/SQLEditorLayout/SQLEditorMenu'
|
|
import { createTabId, useTabsStateSnapshot } from '@/state/tabs'
|
|
import type { NextPageWithLayout } from '@/types'
|
|
|
|
const SqlExamples: NextPageWithLayout = () => {
|
|
const router = useRouter()
|
|
const ref = useParams<{ ref: string }>()?.ref
|
|
const tabs = useTabsStateSnapshot()
|
|
|
|
useEffect(() => {
|
|
if (!router.isReady) return
|
|
|
|
const tabId = createTabId('sql', { id: 'examples' })
|
|
tabs.addTab({
|
|
id: tabId,
|
|
type: 'sql',
|
|
label: 'Examples',
|
|
metadata: {
|
|
sqlId: 'examples',
|
|
name: 'examples',
|
|
},
|
|
})
|
|
}, [router.isReady, ref])
|
|
|
|
return <SQLExamples />
|
|
}
|
|
|
|
SqlExamples.getLayout = (page) => (
|
|
<DefaultLayout>
|
|
<EditorBaseLayout productMenu={<SQLEditorMenu />} product="SQL Editor">
|
|
<SQLEditorLayout>{page}</SQLEditorLayout>
|
|
</EditorBaseLayout>
|
|
</DefaultLayout>
|
|
)
|
|
|
|
export default SqlExamples
|