import { Dialog } from "@headlessui/react";
import React from "react";

type Props = {
  children: React.ReactNode;
};

const _ModalTitle: React.FC<Props> = ({ children }: Props) => {
  if (typeof children === "string") {
    return (
      <Dialog.Title as="h3" className="text-2xl font-bold leading-6 mb-10">
        {children}
      </Dialog.Title>
    );
  }
  return <Dialog.Title as="h3" children={children} />;
}

_ModalTitle.displayName = "ModalTitle";

export default _ModalTitle;