import reactStringReplace from "react-string-replace";

const HIGHLIGHT = /({{.+}})/g;

export default function Tag({children}: {children: string}) {
	return (
		<span className="text-lg font-semibold">
			{reactStringReplace(children, HIGHLIGHT, (match, i) => (
				<span key={i} className="text-white bg-mti-rose-light px-1 py-0">
					{match.replaceAll(/[{}]/g, "")}
				</span>
			))}
		</span>
	);
}
