mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
This PR runs `prettier` on the `examples` folder. Depends on https://github.com/supabase/supabase/pull/43849.
25 lines
607 B
TypeScript
25 lines
607 B
TypeScript
'use client'
|
|
|
|
import useSupabaseBrowser from '@/utils/supabase-browser'
|
|
import { getCountryById } from '@/queries/get-country-by-id'
|
|
import { useQuery } from '@supabase-cache-helpers/postgrest-react-query'
|
|
|
|
export default function CountryPage({ params }: { params: { id: number } }) {
|
|
const supabase = useSupabaseBrowser()
|
|
const { data: country, isLoading, isError } = useQuery(getCountryById(supabase, params.id))
|
|
|
|
if (isLoading) {
|
|
return <div>Loading...</div>
|
|
}
|
|
|
|
if (isError || !country) {
|
|
return <div>Error</div>
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<h1>{country.name}</h1>
|
|
</div>
|
|
)
|
|
}
|