---
import type { HTMLAttributes } from 'astro/types';
const sizes = {
xxl: 'h1',
xl: 'h2',
lg: 'h2',
md: 'h3',
sm: 'h4',
xs: 'h5',
xxs: 'h6',
};
type Headers = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
interface Props extends HTMLAttributes {
size?: keyof typeof sizes
align?: 'left' | 'center' | 'right' | 'inherit'
}
const {
size = 'lg',
align = 'inherit',
...attr
} = Astro.props;
const Element = sizes[size] as any; // Unfortunately gotta do this
const className = (align == 'inherit' ? '' : `text-${align} `)
+ (size == 'xxl' ? ' page-header' : '')
+ (attr.class ? ` ${attr.class}` : '');
---