import { useState } from "react";
import { NotePanel, type NoteComment } from "@leap-crm/design-system";
const people = [
{ name: "Mia Gold", initials: "MG" },
{ name: "Sam Evans", initials: "SE" },
];
const body =
"Agent called: the vendor prefers 60 days and will take 45 with a 10% deposit. Rose is fine with either.\n\n@Mia Gold to confirm with her lender before we reply. If the lender needs longer than 45 days, we counter at 60 with the 10% deposit.";
function OpenNote() {
const [pinned, setPinned] = useState(true);
const [comments, setComments] = useState<NoteComment[]>([
{
id: "1",
author: people[0] ?? { name: "" },
time: "4:38 pm",
text: "Lender says 45 days is fine if the valuation is back by the 5th.",
},
{
id: "2",
author: people[1] ?? { name: "" },
time: "4:51 pm",
text: "Good, I will tell the agent 45. @Mia Gold can you send the valuation request today?",
},
{
id: "3",
author: people[0] ?? { name: "" },
time: "5:02 pm",
text: "Sent.",
},
]);
return (
<NotePanel
className="w-lg"
kind="call"
context={{ type: "matter", label: "14 Hill St purchase" }}
title="Vendor wants a 60-day settlement"
body={body}
author={{ name: "Sam Evans", initials: "SE", viaFirmPilot: true }}
date="21 Nov, 4:12 pm"
edited
pinned={pinned}
onPinChange={setPinned}
onEdit={() => undefined}
onCopyLink={() => undefined}
onHistory={() => undefined}
onMove={() => undefined}
onDelete={() => undefined}
onClose={() => undefined}
people={people}
you={{ name: "Marcus Hugh", initials: "MH" }}
comments={comments}
onComment={text =>
setComments(list => [
...list,
{
id: String(list.length + 1),
author: { name: "Marcus Hugh", initials: "MH" },
time: "Just now",
text,
},
])
}
/>
);
}