mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
* show cms blog posts in www * remove contentlayer from www * outputFileTracingExcludes * update remotePatterns * fetch cms posts server-side with revalidation * add cms env vars to turbo.json * add www env vars to turbo.json * include cms posts in www sitemap * add migration to remove image from cms post * update cms meta image mapping in www
25 lines
471 B
TypeScript
25 lines
471 B
TypeScript
'use client'
|
|
|
|
import { useRouter } from 'next/router'
|
|
import { useMemo } from 'react'
|
|
|
|
export function useParams(): {
|
|
[k: string]: string | undefined
|
|
} {
|
|
const { query } = useRouter()
|
|
|
|
return useMemo(
|
|
() =>
|
|
Object.fromEntries(
|
|
Object.entries(query).map(([key, value]) => {
|
|
if (Array.isArray(value)) {
|
|
return [key, value[0]]
|
|
} else {
|
|
return [key, value]
|
|
}
|
|
})
|
|
),
|
|
[query]
|
|
)
|
|
}
|