import React from "react" import { twMerge } from "tailwind-merge" import { InformationCircleIcon } from "@heroicons/react/outline" import Tooltip from "./core/Tooltip" interface IText { title?: string subtitle?: string content?: string className?: string action?: { name?: string url?: string className?: string } options?: any } const Text = (props: IText) => { const { title, content, className = "", action, subtitle } = props const options = props.options ?? {} const oClass = options.class || {} const oTooltip = options.tooltip || {} return ( <div className={twMerge(oClass.main, className)}> {title && ( <h2 className={twMerge( "text-2xl font-extrabold sm:text-4xl", oClass.title )} > {title} <Tooltip text={oTooltip.title} /> </h2> )} {subtitle && ( <h4 className={twMerge( "mt-2 text-2xl font-bold", oClass.subtitle )} > {subtitle} <Tooltip text={oTooltip.subtitle} /> </h4> )} {content && ( <> <span className={twMerge( //"pt-10 text-justify text-xl leading-8 sm:text-2xl", "pt-10 text-justify text-xl leading-8 ", oClass.content )} dangerouslySetInnerHTML={{ __html: content }} /> <Tooltip text={oTooltip.content} /> </> )} {action && action.name !== "" ? ( <Button {...action} className={twMerge( "mt-10", action.className, oClass.action )} {...options.action} /> ) : ( <></> )} </div> ) } export default Text