import { AnimatePresence, motion } from 'framer-motion'
import Link from 'next/link'
import { useOrganizationRestrictions } from 'hooks/misc/useOrganizationRestrictions'
import { cn, CriticalIcon, WarningIcon } from 'ui'
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
export const OrganizationResourceBanner = () => {
const { warnings } = useOrganizationRestrictions()
return (
{warnings.map((warning, i) => (
))}
)
}
export const HeaderBanner = ({
type,
title,
message,
link,
}: {
type: 'danger' | 'warning' | 'note' | 'incident'
title: string
message: string
link?: string
}) => {
const bannerStyles =
type === 'danger'
? 'bg-destructive-300 dark:bg-destructive-200'
: type === 'incident'
? 'bg-brand-400'
: 'bg-warning-300 dark:bg-warning-200'
const Icon = type === 'danger' ? CriticalIcon : WarningIcon
return (
{title}
{message}
{link && (
View Details
)}
)
}