import type { JSX } from "solid-js";
import { splitProps } from "solid-js";
import type { AlertProps } from "./alert.props";
export type { AlertProps } from "./alert.props";

/** An alert element that announces important messages to screen readers via role="alert". */
export function Alert(props: AlertProps): JSX.Element {
	const [local, rest] = splitProps(props, ["children"]);
	return (
		<div role="alert" {...rest}>
			{local.children}
		</div>
	);
}
