import { h, JSX } from "preact";

export function Modal({
   hidden,
   className,
   children,
   ...props
}: JSX.HTMLAttributes<HTMLDivElement> & { hidden?: boolean }) {
   return (
      <div
         className={"ht-modal " + className + (hidden ? "ht-modal-hidden" : "")}
         {...props}
      >
         {children}
      </div>
   );
}

export function ModalTitle({
   className,
   children,
   ...props
}: JSX.HTMLAttributes<HTMLDivElement>) {
   return (
      <div className={"ht-modal-title " + className} {...props}>
         {children}
      </div>
   );
}

export function ModalContent({
   className,
   children,
   ...props
}: JSX.HTMLAttributes<HTMLDivElement>) {
   return (
      <div className={"ht-modal-content " + className} {...props}>
         {children}
      </div>
   );
}

export function ModalActions({
   className,
   children,
   ...props
}: JSX.HTMLAttributes<HTMLDivElement>) {
   return (
      <div className={"ht-modal-action " + className} {...props}>
         {children}
      </div>
   );
}
