import { AnimatePresence, motion } from 'framer-motion' import { XIcon } from 'lucide-react' import type { ReactNode } from 'react' import { Button, cn, CriticalIcon, WarningIcon } from 'ui' import { useOrganizationRestrictions } from '@/hooks/misc/useOrganizationRestrictions' const bannerMotionProps = { initial: { height: 0, opacity: 0 }, animate: { height: 'auto', opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, delay: 0.5 }, } as const const linkStyles = '[&_a]:underline [&_a]:underline-offset-2 [&_a]:decoration-foreground-muted/80 [&_a]:hover:decoration-foreground [&_a]:hover:text-foreground [&_a]:transition-all' export const OrganizationResourceBanner = () => { const { warnings } = useOrganizationRestrictions() return ( {warnings.map((warning) => ( ))} ) } interface HeaderBannerProps { variant: 'danger' | 'warning' | 'note' title: string description: string | ReactNode onDismiss?: () => void } const variantStyles = { danger: { banner: 'bg-destructive-200 border-destructive-400', icon: 'text-destructive-200 bg-destructive-600', }, warning: { banner: 'bg-warning-200 border-warning-400', icon: 'text-warning-200 bg-warning-600', }, note: { banner: 'bg-surface-200/25 border-default', icon: 'text-background bg-foreground', }, } as const export const HeaderBanner = ({ variant, title, description, onDismiss }: HeaderBannerProps) => { const { banner: bannerStyles, icon: iconStyles } = variantStyles[variant] const Icon = variant === 'danger' ? CriticalIcon : WarningIcon return ( {/* Wrapped content for smooth reveal animation */} {/* Striped background */} {/* Icon and text content */} {/* Title and description */} {/* Title */} {title} {/* Description */} ยท {typeof description === 'string' ? ( {description} ) : ( {description} )} {onDismiss && ( )} ) }
{title}
{description}