Files
supabase/apps/studio/components/layouts/AdvisorsLayout/AdvisorRulesLayout.tsx
Joshen Lim 50eea124e7 Small tweaks to feature preview badge (#45409)
## Context

Small improvements from this PR:
https://github.com/supabase/supabase/pull/45373

- Fix feature preview badge alignment
  - Before:
<img width="341" height="75" alt="image"
src="https://github.com/user-attachments/assets/e6e2f727-fc75-4f70-b9cd-94d67aed8c5d"
/>
  - After:
<img width="365" height="64" alt="image"
src="https://github.com/user-attachments/assets/3d6e5e5d-c285-48f4-8f8f-251c23101e41"
/>
- Shift feature preview badge for policies into tester side panel
<img width="640" height="93" alt="image"
src="https://github.com/user-attachments/assets/3efb73a7-f7f5-4ae0-8560-d1e0ba989626"
/>
- Realised that advisor settings wasn't set up to be behind the feature
preview
  - Fixing that in this PR

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
  * Added preview badge indicator to the RLS Tester feature

* **Style**
* Improved spacing and layout alignment across authentication, database
access, webhook, logging, and advisor interface components
  * Enhanced badge component styling for better vertical alignment

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-01 10:18:20 +08:00

43 lines
1.4 KiB
TypeScript

import { LOCAL_STORAGE_KEYS, useParams } from 'common'
import { PropsWithChildren } from 'react'
import DefaultLayout from '../DefaultLayout'
import { PageLayout } from '../PageLayout/PageLayout'
import AdvisorsLayout from './AdvisorsLayout'
import { useIsAdvisorRulesEnabled } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { FeaturePreviewBadge } from '@/components/ui/FeaturePreviewBadge'
export const AdvisorRulesLayout = ({ children }: PropsWithChildren<{}>) => {
const { ref } = useParams()
const isAdvisorRulesEnabled = useIsAdvisorRulesEnabled()
return (
<DefaultLayout>
<AdvisorsLayout>
<PageLayout
title={
<span className="flex items-center gap-x-4">
Advisor Settings
{isAdvisorRulesEnabled && (
<FeaturePreviewBadge featureKey={LOCAL_STORAGE_KEYS.UI_PREVIEW_ADVISOR_RULES} />
)}
</span>
}
subtitle="Disable specific advisor categories or rules"
navigationItems={[
{
label: 'Security',
href: `/project/${ref}/advisors/rules/security`,
},
{
label: 'Performance',
href: `/project/${ref}/advisors/rules/performance`,
},
]}
>
{children}
</PageLayout>
</AdvisorsLayout>
</DefaultLayout>
)
}