import { h } from 'preact'; import Button from './Button'; import Heading from './Heading'; export default function Box({ buttons = [], className = '', content, elevated = true, header, href, icons = [], media = null, ...props }) { const Element = href ? 'a' : 'div'; const typeClasses = elevated ? 'shadow-md hover:shadow-lg transition-shadow' : 'border border-gray-200 dark:border-gray-700'; return (
{media || header ? ( {media}
{header ? {header} : null}
) : null} {buttons.length || content || icons.length ? (
{content || null} {buttons.length ? (
{buttons.map(({ name, href }) => ( ))}
{icons.map(({ name, icon: Icon, ...props }) => ( ))}
) : null}
) : null}
); }