Separate request statistics panel from list

This commit is contained in:
lizerk 2026-04-20 12:41:41 +03:00
parent 8a65498b56
commit 49390b1896
2 changed files with 51 additions and 49 deletions

View File

@ -90,58 +90,60 @@ function RequestsPageContent() {
) : h.error ? (
<div className="app-feedback-danger rounded-2xl p-6 text-center"><p className="text-sm">{h.error}</p></div>
) : (
<section className="app-surface rounded-2xl p-4">
{h.swipeMode && h.pendingDecisionRequests.length > 0 ? (
<RequestSwipeModePanel
actionError={h.actionError}
onApprove={h.handleApprove}
onClose={() => h.setSwipeMode(false)}
onReject={h.handleReject}
requests={h.pendingDecisionRequests}
/>
) : (
<>
<>
<RequestStatisticsPanel
canView={canViewStats}
employees={h.employees}
/>
<RequestListControls
actions={requestControlsActions}
feedback={requestControlsFeedback}
state={requestControlsState}
/>
<RequestListSection
busyKey={h.busyKey}
commentDrafts={h.commentDrafts}
commentsMap={h.commentsMap}
currentUserId={user?.id}
departmentNameMap={h.departmentNameMap}
expandedComments={h.expandedComments}
expandedRows={h.expandedRows}
handleAddComment={h.handleAddComment}
handleApprove={h.handleApprove}
handleCancel={h.handleCancel}
handleDelete={h.handleDelete}
handleDeleteComment={h.handleDeleteComment}
handleReject={h.handleReject}
isFinal={h.isFinal}
loadMoreRef={h.loadMoreRef}
loadingMore={h.loadingMore}
nextPage={h.nextPage}
openEdit={h.openEdit}
requestMenuOpenId={screen.requestMenuOpenId}
requestMenuRef={screen.requestMenuRef}
requests={h.requests}
setAttachmentPreview={h.setAttachmentPreview}
onSetCommentDraft={h.setCommentDraft}
setDetailsRequest={h.setDetailsRequest}
setRequestMenuOpenId={screen.setRequestMenuOpenId}
toggleComments={h.toggleComments}
toggleRow={h.toggleRow}
/>
</>
)}
</section>
<section className="app-surface rounded-2xl p-4">
{h.swipeMode && h.pendingDecisionRequests.length > 0 ? (
<RequestSwipeModePanel
actionError={h.actionError}
onApprove={h.handleApprove}
onClose={() => h.setSwipeMode(false)}
onReject={h.handleReject}
requests={h.pendingDecisionRequests}
/>
) : (
<>
<RequestListControls
actions={requestControlsActions}
feedback={requestControlsFeedback}
state={requestControlsState}
/>
<RequestListSection
busyKey={h.busyKey}
commentDrafts={h.commentDrafts}
commentsMap={h.commentsMap}
currentUserId={user?.id}
departmentNameMap={h.departmentNameMap}
expandedComments={h.expandedComments}
expandedRows={h.expandedRows}
handleAddComment={h.handleAddComment}
handleApprove={h.handleApprove}
handleCancel={h.handleCancel}
handleDelete={h.handleDelete}
handleDeleteComment={h.handleDeleteComment}
handleReject={h.handleReject}
isFinal={h.isFinal}
loadMoreRef={h.loadMoreRef}
loadingMore={h.loadingMore}
nextPage={h.nextPage}
openEdit={h.openEdit}
requestMenuOpenId={screen.requestMenuOpenId}
requestMenuRef={screen.requestMenuRef}
requests={h.requests}
setAttachmentPreview={h.setAttachmentPreview}
onSetCommentDraft={h.setCommentDraft}
setDetailsRequest={h.setDetailsRequest}
setRequestMenuOpenId={screen.setRequestMenuOpenId}
toggleComments={h.toggleComments}
toggleRow={h.toggleRow}
/>
</>
)}
</section>
</>
)}
<RequestDetailModal

View File

@ -80,7 +80,7 @@ export function RequestStatisticsPanel({
] : [];
return (
<div className="app-surface mb-4 overflow-hidden rounded-2xl">
<div className="app-surface overflow-hidden rounded-2xl">
<button
type="button"
onClick={() => setOpen((current) => !current)}