mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 19:35:06 +03:00
Add generic building blocks for blocking features on High Availability projects: - useHighAvailability hook: HA state only (isHighAvailability, isPending) - HighAvailabilityDisabledEmptyState (full-page empty state) - HighAvailabilityDisabledSectionNotice (in-section admonition) The components carry a generic default title/description; consuming pages pass their own copy via props. HA state is read from the project's high_availability flag (same source as the High Availability badge on the project home page). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added clearer messaging for features that aren’t available in High Availability projects. * Introduced a standard High Availability status check to help the app adapt what it shows. * **Bug Fixes** * Hid non-applicable schema options when High Availability is enabled, reducing confusion in selection lists. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
907 B
TypeScript
29 lines
907 B
TypeScript
import type { ReactNode } from 'react'
|
|
import { Admonition } from 'ui-patterns/admonition'
|
|
|
|
import { useHighAvailability } from '@/hooks/misc/useHighAvailability'
|
|
|
|
const DEFAULT_TITLE = 'This feature is unavailable on High Availability projects'
|
|
const DEFAULT_DESCRIPTION =
|
|
"We're working to bring this feature to High Availability projects. Contact support if this is blocking your work."
|
|
|
|
interface HighAvailabilityDisabledSectionNoticeProps {
|
|
title?: string
|
|
description?: ReactNode
|
|
}
|
|
|
|
export function HighAvailabilityDisabledSectionNotice({
|
|
title = DEFAULT_TITLE,
|
|
description = DEFAULT_DESCRIPTION,
|
|
}: HighAvailabilityDisabledSectionNoticeProps) {
|
|
const { isHighAvailability } = useHighAvailability()
|
|
|
|
if (!isHighAvailability) return null
|
|
|
|
return (
|
|
<Admonition type="default" title={title}>
|
|
<p className="text-sm text-foreground-light">{description}</p>
|
|
</Admonition>
|
|
)
|
|
}
|