mirror of
https://github.com/supabase/supabase.git
synced 2026-05-15 15:19:27 +08:00
* Add clear search CTA for logs input * Fix searching in pg cron logs + unselect selected log when search input changes * Fix updating search to clear selected row * Fix alignment of function name * Fix spacing for LogsPreviewer used in functions * Reorder edge functions nav + clean up
31 lines
832 B
TypeScript
31 lines
832 B
TypeScript
import { Tabs } from 'ui'
|
|
import { useRouter } from 'next/router'
|
|
|
|
const FunctionsNav = ({ item }: any) => {
|
|
const router = useRouter()
|
|
const activeRoute = router.pathname.split('/')[5]
|
|
const { ref } = router.query
|
|
|
|
return (
|
|
<Tabs
|
|
defaultActiveId="1"
|
|
type="underlined"
|
|
size="medium"
|
|
baseClassNames="!space-y-0"
|
|
activeId={!activeRoute ? 'overview' : activeRoute}
|
|
onChange={(e: string) => {
|
|
if (item?.slug) {
|
|
router.push(`/project/${ref}/functions/${item.slug}/${e === 'overview' ? '' : e}`)
|
|
}
|
|
}}
|
|
>
|
|
<Tabs.Panel id="overview" label="Overview" />
|
|
<Tabs.Panel id="invocations" label="Invocations" />
|
|
<Tabs.Panel id="logs" label="Logs" />
|
|
<Tabs.Panel id="details" label="Details" />
|
|
</Tabs>
|
|
)
|
|
}
|
|
|
|
export default FunctionsNav
|