blob: 28149f09480c9d82ee63188bef534028864ca0e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
import type { FullNode, Poast } from "@/types/trill";
import { date_diff } from "@/logic/utils";
import { useLocation } from "wouter";
import Body from "./Body";
import Sigil from "../Sigil";
// function Quote({
// data,
// refetch,
// nest,
// }: {
// data: FullNode;
// refetch?: Function;
// nest: number;
// }) {
// const [_, navigate] = useLocation();
// function gotoQuote(e: React.MouseEvent) {
// e.stopPropagation();
// navigate(`/feed/${data.host}/${data.id}`);
// }
// return (
// <div onMouseUp={gotoQuote} className="quote-in-post">
// <header className="btw">
// (
// <div className="quote-author flex">
// <Sigil patp={data.author} size={20} />
// {data.author}
// </div>
// )<span>{date_diff(data.time, "short")}</span>
// </header>
// <Body poast={toFlat(data)} nest={nest} refetch={refetch!} />
// </div>
// );
// }
function Quote({
data,
refetch,
nest,
}: {
data: Poast;
refetch?: Function;
nest: number;
}) {
const [_, navigate] = useLocation();
function gotoQuote(e: React.MouseEvent) {
e.stopPropagation();
navigate(`/feed/${data.host}/${data.id}`);
}
return (
<div onMouseUp={gotoQuote} className="quote-in-post">
<header className="btw">
(
<div className="quote-author flex">
<Sigil patp={data.author} size={20} />
{data.author}
</div>
)<span>{date_diff(data.time, "short")}</span>
</header>
<Body poast={data} nest={nest} refetch={refetch!} />
</div>
);
}
export default Quote;
|