Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 21:01:03 +00:00
co-authored by renee-png
parent 69ecf85674
commit 1ad147596b
+26 -1
View File
@@ -978,7 +978,15 @@ function ListView({ events }: { events: Evt[] }) {
);
}
function EventRow({ evt, showDate }: { evt: Evt; showDate?: boolean }) {
function EventRow({
evt,
showDate,
onEdit,
}: {
evt: Evt;
showDate?: boolean;
onEdit?: (e: Evt) => void;
}) {
const meta = typeMeta(evt.event_type);
const Icon = evt.source === "task" ? CheckSquare : Briefcase;
const content = (
@@ -997,6 +1005,9 @@ function EventRow({ evt, showDate }: { evt: Evt; showDate?: boolean }) {
{!evt.all_day && <span>{format(parseISO(evt.start), "h:mm a")}</span>}
{evt.all_day && <span>All day</span>}
{evt.case_label && <span className="truncate">· {evt.case_label}</span>}
{evt.client_label && !evt.case_label && (
<span className="truncate">· {evt.client_label}</span>
)}
{evt.owner_name && <span>· {evt.owner_name}</span>}
{evt.location && (
<span className="flex items-center gap-1">
@@ -1007,6 +1018,20 @@ function EventRow({ evt, showDate }: { evt: Evt; showDate?: boolean }) {
</div>
</div>
);
// For real "event" rows, clicking opens the edit dialog (preferred over case nav).
if (evt.source === "event" && onEdit) {
return (
<li>
<button
type="button"
onClick={() => onEdit(evt)}
className="w-full text-left"
>
{content}
</button>
</li>
);
}
if (evt.case_id) {
return (
<li>