Files
supabase/apps/studio/components/ui/FeaturePreviewBadge.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

34 lines
938 B
TypeScript

import { FlaskConical } from 'lucide-react'
import { Badge, cn } from 'ui'
import { useFeaturePreviewModal } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext'
interface FeaturePreviewBadgeProps {
featureKey: string
className?: string
}
export const FeaturePreviewBadge = ({ featureKey, className }: FeaturePreviewBadgeProps) => {
const { selectFeaturePreview } = useFeaturePreviewModal()
return (
<button
type="button"
onClick={() => selectFeaturePreview(featureKey)}
className="group flex items-center"
title="Feature preview — click to manage"
>
<Badge
variant="default"
className={cn(
'cursor-pointer group-hover:border-foreground-light group-hover:text-foreground transition-colors',
className
)}
>
<FlaskConical size={8} strokeWidth={1.5} />
Feature preview
</Badge>
</button>
)
}