// import spinner from "@/assets/icons/spinner.svg";
import Composer from "@/components/composer/Composer";
import PostList from "@/components/feed/PostList";
import useLocalState from "@/state/state";
import type { Ship } from "@/types/urbit";

function UserFeed({ p }: { p: Ship }) {
  const { api, following } = useLocalState();
  const feed = following.get(api!.airlock.our!);
  const refetch = () => feed;
  if (p === api!.airlock.our)
    return (
      <div id="feed-proper">
        <Composer />
        <PostList data={feed!} refetch={refetch} />
      </div>
    );
}

export default UserFeed;
