summaryrefslogtreecommitdiffstats
path: root/src/ui/objects/Figure.tsx
blob: 7f5e20aab2dc9973cad25f3a83130af7596b94db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import type { HTMLAttributes } from "corvos/plugins/jsx.ts";

export type Props = HTMLAttributes<"figure"> & {
	children?: JSX.Element;
	caption?: JSX.Element;
};

export const Figure = ({ children, caption, class: cls, ...props }: Props) => (
	<figure class:list={["o-figure", cls]} {...props}>
		{children}
		{caption && <figcaption class="o-figure__caption">{caption}</figcaption>}
	</figure>
);