ThemePreact/src/List.tsx

27 lines
505 B
TypeScript

import { h, JSX } from "preact";
export interface IListProps {
clickable?: boolean;
divider?: boolean;
}
export default function List({
clickable,
divider,
className,
class: c,
children,
...props
}: JSX.HTMLAttributes<HTMLUListElement> & IListProps) {
let cl = "ht-list ";
if (clickable) cl += "ht-list-clickable ";
if (divider) cl += "ht-list-divider ";
return (
<ul className={cl + (className || "") + c} {...props}>
{children}
</ul>
);
}