'use client'
import { useState, useEffect } from "react";

export default function BlogContent({ content }) {
  const [email, setEmail] = useState("");

  useEffect(() => {
    const user = "bloor";
    const domain = "rapharehab.ca";
    setEmail(`${user}@${domain}`);
  }, []);

  const processedContent = content.replace(
    'bloor@rapharehab.ca',
    email ? `<a href="mailto:${email}">${email}</a>` : '<span>Loading...</span>'
  );

  return (
    <div dangerouslySetInnerHTML={{ __html: processedContent }} />
  );
}