{visibleTabs.map((item) => {
diff --git a/frontend/src/components/finance/admin/PayrollCellCommentsModal.tsx b/frontend/src/components/finance/admin/PayrollCellCommentsModal.tsx
index 0311a4fd..3ae3ca2c 100644
--- a/frontend/src/components/finance/admin/PayrollCellCommentsModal.tsx
+++ b/frontend/src/components/finance/admin/PayrollCellCommentsModal.tsx
@@ -30,7 +30,11 @@ type PayrollCellCommentsModalProps = {
cell: PayrollCommentCell | null;
currentUserId?: number | null;
onClose: () => void;
- onCommentCountChange: (cell: PayrollCommentCell, count: number) => void;
+ onCommentCountChange: (
+ cell: PayrollCommentCell,
+ count: number,
+ latestText: string,
+ ) => void;
periodId: number;
};
@@ -71,7 +75,7 @@ export function PayrollCellCommentsModal({
activeCell.columnId,
);
setComments(next);
- onCommentCountChange(activeCell, next.length);
+ onCommentCountChange(activeCell, next.length, next.at(-1)?.text || "");
} catch (loadError) {
setComments([]);
setError(
@@ -129,7 +133,7 @@ export function PayrollCellCommentsModal({
const next = [...comments, saved];
setComments(next);
setDraft("");
- onCommentCountChange(cell, next.length);
+ onCommentCountChange(cell, next.length, next.at(-1)?.text || "");
} catch (sendError) {
setError(
getPayrollAdminError(sendError, "Не удалось отправить комментарий."),
@@ -153,7 +157,7 @@ export function PayrollCellCommentsModal({
);
const next = comments.filter((item) => item.id !== comment.id);
setComments(next);
- onCommentCountChange(cell, next.length);
+ onCommentCountChange(cell, next.length, next.at(-1)?.text || "");
} catch (deleteError) {
setError(
getPayrollAdminError(deleteError, "Не удалось удалить комментарий."),
diff --git a/frontend/src/components/finance/admin/PayrollPeriodTable.tsx b/frontend/src/components/finance/admin/PayrollPeriodTable.tsx
index aca5c9c6..615bafbb 100644
--- a/frontend/src/components/finance/admin/PayrollPeriodTable.tsx
+++ b/frontend/src/components/finance/admin/PayrollPeriodTable.tsx
@@ -1681,10 +1681,12 @@ function CellCommentButton({
count,
label,
onClick,
+ preview,
}: {
count: number;
label: string;
onClick: () => void;
+ preview?: string;
}) {
if (count) {
return (
@@ -1696,7 +1698,7 @@ function CellCommentButton({
}}
className="absolute right-1 top-1 z-10 rounded border border-sky-500/60 bg-sky-500/15 px-1 text-[9px] font-semibold leading-3 text-sky-400 transition hover:bg-sky-500/25 hover:text-sky-300"
aria-label={`${label}: открыть комментарии, ${count}`}
- title="Открыть комментарии"
+ title={preview || "Открыть комментарии"}
>
К:{count}
@@ -1724,12 +1726,14 @@ function CommentableValueCell({
commentCount,
commentLabel,
onOpenComment,
+ commentPreview,
}: {
children: ReactNode;
className?: string;
commentCount: number;
commentLabel: string;
onOpenComment: () => void;
+ commentPreview?: string;
}) {
return (
|
@@ -1737,6 +1741,7 @@ function CommentableValueCell({
count={commentCount}
label={commentLabel}
onClick={onOpenComment}
+ preview={commentPreview}
/>
{children}
|
@@ -1759,6 +1764,7 @@ function ProjectionPointsCell({
onOpen,
commentCount,
onOpenComment,
+ commentPreview,
cellClassName = "",
}: {
value: string | null;
@@ -1767,6 +1773,7 @@ function ProjectionPointsCell({
onOpen: () => void;
commentCount: number;
onOpenComment: () => void;
+ commentPreview?: string;
cellClassName?: string;
}) {
const difference = comparePayrollProjection(value, actualPoints);
@@ -1790,6 +1797,7 @@ function ProjectionPointsCell({
count={commentCount}
label={label}
onClick={onOpenComment}
+ preview={commentPreview}
/>