mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 12:55:06 +03:00
* init request upgrade plan modal * Consolidate UpgradeToPro components across UI + use UpgradePlanButton, UpgradePlanButton determines whether to show request upgrade CTA * Allow to pass icon to Admonition * Tiny fix on upgrade plan button CTA to consider addons * Hook up upgrade request endpoint * Update API types * remove hardcode * Add request upgrade CTA in plan side panel * Fix disk compute * Show request upgrade button for change to large compute * Nit
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { AnimatePresence, motion } from 'framer-motion'
|
|
import { type ComponentProps, type ReactNode } from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
import { Admonition } from 'ui-patterns'
|
|
|
|
interface NoticeBarProps extends Omit<ComponentProps<typeof Admonition>, 'description'> {
|
|
title?: string
|
|
description?: string
|
|
icon?: ReactNode
|
|
visible: boolean
|
|
actions?: ReactNode
|
|
}
|
|
export function NoticeBar({ visible, description, actions, ...props }: NoticeBarProps) {
|
|
return (
|
|
<AnimatePresence>
|
|
{visible && (
|
|
<motion.div
|
|
initial={{ opacity: 0, height: 0, y: 4 }}
|
|
animate={{ opacity: 1, height: 'auto', y: 0 }}
|
|
exit={{ opacity: 0, height: 0, y: 4 }}
|
|
transition={{ duration: 0.15 }}
|
|
>
|
|
<Admonition {...props} className={cn(props.className, 'mb-0')}>
|
|
{description}
|
|
<div className="flex flex-col gap-2">
|
|
{actions && <div className="mt-2">{actions}</div>}
|
|
</div>
|
|
</Admonition>
|
|
</motion.div>
|
|
)}
|
|
</AnimatePresence>
|
|
)
|
|
}
|