import "./Note.css";
import { useCallback } from "react";
import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import Event from "../nostr/Event";
import ProfileImage from "./ProfileImage";
import Text from "../Text";
import { eventLink, hexToBech32 } from "../Util";
import NoteFooter from "./NoteFooter";
import NoteTime from "./NoteTime";
export default function Note(props) {
const navigate = useNavigate();
const opt = props.options;
const dataEvent = props["data-ev"];
const { data, isThread, reactions, deletion, hightlight } = props
const users = useSelector(s => s.users?.users);
const ev = dataEvent ?? Event.FromObject(data);
const options = {
showHeader: true,
showTime: true,
showFooter: true,
...opt
};
const transformBody = useCallback(() => {
let body = ev?.Content ?? "";
if (deletion?.length > 0) {
return (Deleted);
}
return
{JSON.stringify(ev.ToObject(), undefined, ' ')}> ); } return (