import ImageStyle from "@/styles/Image.module.sass" import Link from "./Link"; // const regex = /@(?\w*)@(?\w*\S*)/gm; const Image = ({ src, alt }: { src: string, alt: string }) => { const regex = /@(?\w+)@(?\w{2,}\.[a-z]{2,10})/gm; if (alt.match(regex)) { const newAlt = alt.replace("art by", "") const sub = "https://$/@$"; const link = newAlt.replace(regex, sub); return (
{alt} art by
) } else { return (
{alt} {alt}
); } }; export default Image;