import { useCallback, useEffect, useMemo, useState } from "react"; import { Link } from "react-router-dom"; import { ExternalLink, MessageSquareText, Send, Star } from "lucide-react"; import { api } from "../api.js"; import { Badge, Button, cx, Empty, ErrorNote, fmt, Panel, Spinner, timeAgo } from "../ui.jsx"; function Stars({ n }) { if (n == null) return null; return ( {[1, 2, 3, 4, 5].map((i) => ); } function NotConnected({ platform, client, error }) { return ( Open Connections}> {error?.message || `Connect ${platform} on the Connections page first.`} ); } function ReviewRow({ r, client, onReplied }) { const [text, setText] = useState(""); const [open, setOpen] = useState(false); const [busy, setBusy] = useState(false); const [error, setError] = useState(null); const send = async () => { setBusy(true); setError(null); try { const { reply } = await api("/api/inbox/reviews/reply", { method: "POST", body: { client, reviewId: r.id, text } }); onReplied(reply); setOpen(false); setText(""); } catch (e) { setError(e); } setBusy(false); }; return (
  • {r.author}{timeAgo(r.at)} {!r.reply && No reply yet}
    {r.text ?

    {r.text}

    :

    Rating only, no text.

    } {r.reply &&
    Your reply · {timeAgo(r.reply.at)}

    {r.reply.text}

    } {!open ? ( ) : (