Files
supabase/apps/studio/components/ui/FeaturePreviewSidebarPanel.tsx
Jonathan Summers-Muir 41a5c39305 Feat/logs preview (#37230)
* Add unified logs feature preview and toggle controls

Introduces a unified logs feature preview, allowing users to enable or disable a new logs interface with enhanced filtering and real-time updates. Adds context hooks, UI components (UnifiedLogsPreview, LogsSwitchBox), and conditional logic to display the new interface or revert to the old one. Updates routing and feature preview modal to support the unified logs preview, and extends local storage keys for feature flag management.

* Refactor log UI components and remove LogsSwitchBox

Replaced custom SVG icons with Lucide React icons in LogsSidebarMenuV2 and FilterSideBar for consistency and maintainability. Removed the unused LogsSwitchBox component and cleaned up related imports in FeaturePreviewModal.

* Refactor sidebar panels to use FeaturePreviewSidebarPanel

Introduces a reusable FeaturePreviewSidebarPanel component and replaces InnerSideBarEmptyPanel usages in LogsSidebarMenuV2 and FilterSideBar. Removes unified logs feature flag logic from Sidebar and NavigationBar.utils, simplifying route generation and UI logic.

* Refine sidebar panel styles and remove unused icon

Removed the unused Sparkles icon import from LogsSidebarMenuV2. Updated FeaturePreviewSidebarPanel to use 'bg-muted/10' for background, simplified class names for text alignment, and cleaned up redundant text-left classes for improved styling consistency.

* Update FeaturePreviewModal.tsx

* Update FeaturePreview.constants.tsx

* Clean up

* Final clean up

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-07-17 16:14:04 +08:00

40 lines
1.0 KiB
TypeScript

import { ReactNode } from 'react'
import { cn } from 'ui'
interface FeaturePreviewSidebarPanelProps {
title: string
description: string
illustration?: ReactNode
actions?: ReactNode
className?: string
}
export function FeaturePreviewSidebarPanel({
title,
description,
illustration,
actions,
className,
}: FeaturePreviewSidebarPanelProps) {
return (
<div
className={cn(
'rounded-lg border p-4 space-y-3',
'bg-muted/10 border-border/50',
// Force left alignment and override any centering
'text-left [&_*]:text-left [&_div]:items-start',
className
)}
>
{illustration && <div className="flex justify-start items-start">{illustration}</div>}
<div className="space-y-1">
<h3 className="font-medium text-sm text-foreground">{title}</h3>
<p className="text-xs text-foreground-light">{description}</p>
</div>
{actions && <div className="flex justify-start items-start gap-x-2">{actions}</div>}
</div>
)
}