"use client";

import React, { useEffect, useState } from "react";

type ActivityFeedComponent = React.ComponentType<Record<string, never>>;

export default function ActivityFeedClient() {
  const [Comp, setComp] = useState<ActivityFeedComponent | null>(null);

  useEffect(() => {
    let cancelled = false;
    (async () => {
      try {
        const mod = await import("../components/ActivityFeed");
        const C = (mod as unknown as { default?: ActivityFeedComponent }).default;
        if (!cancelled && typeof C === "function") {
          setComp(() => C);
        }
      } catch {
        // ignore
      }
    })();
    return () => {
      cancelled = true;
    };
  }, []);

  if (!Comp) return null;
  return <Comp />;
}

