import type { Color } from '@yaakapp-internal/plugins'; import classNames from 'classnames'; import { useKeyValue } from '../../hooks/useKeyValue'; import type { BannerProps } from './Banner'; import { Banner } from './Banner'; import { Button } from './Button'; import { HStack } from './Stacks'; export function DismissibleBanner({ children, className, id, actions, ...props }: BannerProps & { id: string; actions?: { label: string; onClick: () => void; color?: Color }[]; }) { const { set: setDismissed, value: dismissed } = useKeyValue({ namespace: 'global', key: ['dismiss-banner', id], fallback: false, }); if (dismissed) return null; return ( {children} {actions?.map((a) => ( ))} ); }