korbit-ai[bot] commented on code in PR #34708:
URL: https://github.com/apache/superset/pull/34708#discussion_r2282632476
##########
superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx:
##########
@@ -292,34 +293,23 @@ const Tabs = props => {
[selectedTabIndex, handleClickTab],
);
- const showDeleteConfirmModal = useCallback(
- key => {
+ const showDeleteConfirmModal = useCallback(key => {
+ setTabToDelete(key);
+ }, []);
Review Comment:
### Unnecessary Function Abstraction <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The showDeleteConfirmModal function is overly simplified and only serves as
a wrapper for setTabToDelete, making it an unnecessary abstraction.
###### Why this matters
Unnecessary abstractions increase code complexity and make the codebase
harder to maintain without providing any real benefits.
###### Suggested change ∙ *Feature Preview*
Remove the showDeleteConfirmModal function and directly use setTabToDelete
where needed:
```jsx
handleEdit = (event, action) => {
if (action === 'remove') {
setTabToDelete(event);
}
// ...
}
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7fce9703-b283-4079-a37d-d42a21d3cb3b/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7fce9703-b283-4079-a37d-d42a21d3cb3b?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7fce9703-b283-4079-a37d-d42a21d3cb3b?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7fce9703-b283-4079-a37d-d42a21d3cb3b?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7fce9703-b283-4079-a37d-d42a21d3cb3b)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:ea5439e8-ea8a-487f-aea4-86da7a6ba975 -->
[](ea5439e8-ea8a-487f-aea4-86da7a6ba975)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]