import { Children, For, Indent, List, splitProps } from "@alloy-js/core"; export function makeTag(tag: string) { return (props: { children?: Children } & T) => { const [children, rest] = splitProps(props, ["children"]); return ( {`<`} {tag} {children.children ? <> {`>`} {``} : ` />`} ); }; } function Attributes(props: { attributes: Record }) { const attributes = Object.entries(props.attributes).filter( ([K, v]) => v !== undefined, ); return ( <> {attributes.length === 0 ? "" : " "} {([key, value]) => `${key}="${value}"`} ); }