import { Link, Typography, TypographyProps } from "@mui/material"; import { createMarkup } from "../../../helpers/common"; import React from "react"; interface EventTitleProps { title: string; url?: string; variant?: TypographyProps["variant"]; } const EventTitle = (props: EventTitleProps) => { const { title, url, variant } = props; const markup = createMarkup(title); if (url) { return ( <Link href={url} className="event-title" sx={{ textDecoration: "none", "&:hover, :focus": { textDecoration: "underline", }, }} dangerouslySetInnerHTML={markup} /> ); } return ( <span dangerouslySetInnerHTML={markup} /> ); }; const Title = ({ children, variant, }: { children: React.ReactNode; variant?: TypographyProps["variant"]; }) => { return ( {children} ); }; export default EventTitle; export { Title };