Skip to content

Commit

Permalink
hide delete if no calls are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlee64 committed Oct 8, 2024
1 parent 483ae68 commit c86b51a
Showing 1 changed file with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,25 +769,27 @@ export const CallsTable: FC<{
disabled={selectedCalls.length === 0}
/>
)}
{!isReadonly && (
<div className="flex-none">
<BulkDeleteButton
onClick={() => setDeleteConfirmModalOpen(true)}
disabled={selectedCalls.length === 0}
/>
<ConfirmDeleteModal
calls={tableData
.filter(row => selectedCalls.includes(row.id))
.map(traceCallToUICallSchema)}
confirmDelete={deleteConfirmModalOpen}
setConfirmDelete={setDeleteConfirmModalOpen}
onDeleteCallback={() => {
setSelectedCalls([]);
}}
/>
</div>
{!isReadonly && selectedCalls.length !== 0 && (
<>
<div className="flex-none">
<BulkDeleteButton
onClick={() => setDeleteConfirmModalOpen(true)}
disabled={selectedCalls.length === 0}
/>
<ConfirmDeleteModal
calls={tableData
.filter(row => selectedCalls.includes(row.id))
.map(traceCallToUICallSchema)}
confirmDelete={deleteConfirmModalOpen}
setConfirmDelete={setDeleteConfirmModalOpen}
onDeleteCallback={() => {
setSelectedCalls([]);
}}
/>
</div>
<ButtonDivider />
</>
)}
<ButtonDivider />

<div className="flex-none">
<ExportSelector
Expand Down

0 comments on commit c86b51a

Please sign in to comment.