diff --git a/web/src/pages/items/ItemDetailPage.tsx b/web/src/pages/items/ItemDetailPage.tsx index ef4e679..95e674d 100644 --- a/web/src/pages/items/ItemDetailPage.tsx +++ b/web/src/pages/items/ItemDetailPage.tsx @@ -1125,290 +1125,290 @@ export function ItemDetailPage() { )} + - {/* Payment / Renewal history */} -
-

{t("items.renewHistory")}

- - {payments.length === 0 ? ( -

- {t("dashboard.noData")} -

- ) : ( - <> - {/* Desktop */} -
- - - - {[ - t("common.date"), - t("items.amount"), - t("items.type"), - t("common.note"), - t("common.period"), - t("common.actions"), - ].map((h) => ( - - ))} - - - - {payments.map((p) => - editingPayment?.id === p.id ? ( - - - - - + + ), + )} + +
- {h} -
- - setEditingPayment({ - ...editingPayment, - date: e.target.value, - }) - } - /> - - - setEditingPayment({ - ...editingPayment, - amount: e.target.value, - }) - } - /> - - {t(`items.paymentType.${p.type}`)} - - + {/* Payment / Renewal history */} +
+

{t("items.renewHistory")}

+ + {payments.length === 0 ? ( +

+ {t("dashboard.noData")} +

+ ) : ( + <> + {/* Desktop */} +
+ + + + {[ + t("common.date"), + t("items.amount"), + t("items.type"), + t("common.note"), + t("common.period"), + t("common.actions"), + ].map((h) => ( + + ))} + + + + {payments.map((p) => + editingPayment?.id === p.id ? ( + + + + + + + + + ) : ( + + + + + + + - - - - ) : ( - - - - - - - - - ), - )} - -
+ {h} +
+ + setEditingPayment({ + ...editingPayment, + date: e.target.value, + }) + } + /> + + + setEditingPayment({ + ...editingPayment, + amount: e.target.value, + }) + } + /> + + {t(`items.paymentType.${p.type}`)} + + + setEditingPayment({ + ...editingPayment, + note: e.target.value, + }) + } + /> + + {p.period_start && p.period_end + ? `${p.period_start} → ${p.period_end}` + : "—"} + +
+ + +
+
+ {p.date.slice(0, 10)} + + {p.currency} {p.amount.toFixed(2)} + + {t(`items.paymentType.${p.type}`)} + + {p.note || "—"} + + {p.period_start && p.period_end + ? `${p.period_start} → ${p.period_end}` + : "—"} + +
+
- {p.period_start && p.period_end - ? `${p.period_start} → ${p.period_end}` - : "—"} - -
- - -
-
- {p.date.slice(0, 10)} - - {p.currency} {p.amount.toFixed(2)} - - {t(`items.paymentType.${p.type}`)} - - {p.note || "—"} - - {p.period_start && p.period_end - ? `${p.period_start} → ${p.period_end}` - : "—"} - -
- - -
-
-
+ className="p-1 rounded hover:bg-accent" + > + + + + +
+
- {/* Mobile */} -
- {payments.map((p) => - editingPayment?.id === p.id ? ( -
-
- - setEditingPayment({ - ...editingPayment, - date: e.target.value, - }) - } - /> - - setEditingPayment({ - ...editingPayment, - amount: e.target.value, - }) - } - placeholder={t("items.amount")} - /> - - setEditingPayment({ - ...editingPayment, - note: e.target.value, - }) - } - placeholder={t("common.note")} - /> -
-
- - -
+ {/* Mobile */} +
+ {payments.map((p) => + editingPayment?.id === p.id ? ( +
+
+ + setEditingPayment({ + ...editingPayment, + date: e.target.value, + }) + } + /> + + setEditingPayment({ + ...editingPayment, + amount: e.target.value, + }) + } + placeholder={t("items.amount")} + /> + + setEditingPayment({ + ...editingPayment, + note: e.target.value, + }) + } + placeholder={t("common.note")} + />
- ) : ( -
-
- {p.date.slice(0, 10)} - - {p.currency} {p.amount.toFixed(2)} - -
-
+
+ + +
+
+ ) : ( +
+
+ {p.date.slice(0, 10)} + + {p.currency} {p.amount.toFixed(2)} + +
+
+ + {t(`items.paymentType.${p.type}`)} + {p.note ? ` · ${p.note}` : ""} + + {p.period_start && p.period_end && ( - {t(`items.paymentType.${p.type}`)} - {p.note ? ` · ${p.note}` : ""} + {p.period_start} → {p.period_end} - {p.period_start && p.period_end && ( - - {p.period_start} → {p.period_end} - - )} -
-
- - -
+ )}
- ), - )} -
- - )} -
- - {/* Delete */} -
- -
- +
+ + +
+ + ), + )} + + + )} + + + {/* Delete */} +
+ +
{/* Right rail: due summary card (§5 items/:id) */} -