import type { PostID, Poast, Reference } from "@/types/trill";
import Header from "./Header";
import Body from "./Body";
import Footer from "./Footer";
import { useLocation } from "wouter";
import useLocalState from "@/state/state";
import RP from "./RP";
import ShipModal from "../modals/ShipModal";
import type { Ship } from "@/types/urbit";
import Sigil from "../Sigil";
import type { UserProfile } from "@/types/nostrill";
export interface PostProps {
poast: Poast;
fake?: boolean;
rter?: Ship;
rtat?: number;
rtid?: PostID;
nest?: number;
refetch?: Function;
profile?: UserProfile;
}
function Post(props: PostProps) {
console.log("post", props);
const { poast } = props;
if (!poast || poast.contents === null) {
return null;
}
const isRP =
poast.contents.length === 1 &&
"ref" in poast.contents[0] &&
poast.contents[0].ref.type === "trill";
if (isRP) {
const ref = (poast.contents[0] as Reference).ref;
return (
);
} else return