korbit-ai[bot] commented on code in PR #31811:
URL: https://github.com/apache/superset/pull/31811#discussion_r1929083853
##########
superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx:
##########
@@ -24,10 +24,16 @@ import ErrorAlert from './ErrorAlert';
function FrontendNetworkErrorMessage({
error,
subtitle,
+ compact,
}: ErrorMessageComponentProps) {
const { level, message } = error;
return (
- <ErrorAlert errorType={t('Network Error')} message={message} type={level}
/>
+ <ErrorAlert
+ compact={compact}
+ errorType={t('Network Error')}
+ message={message}
+ type={level}
+ />
);
}
Review Comment:
### Unused subtitle prop <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The 'subtitle' prop is declared but never used in the component, which
contradicts the expected functionality of displaying a subtitle when provided.
###### Why this matters
If a consumer passes a subtitle prop, they would expect it to be displayed,
leading to confusing behavior when the subtitle doesn't appear in the UI.
###### Suggested change ∙ *Feature Preview*
Either remove the unused subtitle prop or implement it in the ErrorAlert
component:
```typescript
function FrontendNetworkErrorMessage({
error,
subtitle,
compact,
}: ErrorMessageComponentProps) {
const { level, message } = error;
return (
<ErrorAlert
compact={compact}
errorType={t('Network Error')}
message={message}
subtitle={subtitle}
type={level}
/>
);
}
```
</details>
<sub>💡 Does this comment miss the mark? [Tell us
why](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/acab52cc-66c8-47f8-ad63-6734316db410?suggestedFixEnabled=true)
and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.
</sub>
<!--- korbi internal id:5407c872-4161-48a9-b518-9315016dea7c -->
--
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]