-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
004-nov-21-vendorsemptystate-newsvg #272
004-nov-21-vendorsemptystate-newsvg #272
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
Clients/src/presentation/components/Table/WithPlaceholder/index.tsx (2)
169-177
: Consider formatting the style object consistently.The style properties have inconsistent spacing. Some properties have spaces after the colon while others don't.
Apply this formatting for consistency:
style={{ display: "flex", justifyContent: "center", flexDirection: "column", alignItems: "center", border: "1px solid #EEEEEE", borderRadius: "4px", borderTop: "none", padding: theme.spacing(5), paddingTop: theme.spacing(10), paddingBottom: theme.spacing(20), marginTop: theme.spacing(4), }}
180-184
: Consider extracting and formatting the image style object.The inline style prop is hard to read and has inconsistent formatting. Consider extracting it to improve readability.
Apply this refactor:
- <img src={Placeholder} alt="Placeholder" - style={{width: "150px", - height:"auto", - marginTop: theme.spacing(4), - marginBottom:theme.spacing(4)}} /> + <img + src={Placeholder} + alt="Placeholder" + style={{ + width: "150px", + height: "auto", + marginTop: theme.spacing(4), + marginBottom: theme.spacing(4), + }} + />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
Clients/src/presentation/components/Table/WithPlaceholder/index.tsx
(2 hunks)
🔇 Additional comments (2)
Clients/src/presentation/components/Table/WithPlaceholder/index.tsx (2)
28-28
: LGTM! Good choice switching to SVG format.
The switch from PNG to SVG for the placeholder image is a good improvement as SVGs are resolution-independent and typically smaller in file size.
Also applies to: 31-31
185-187
: LGTM! Well-structured empty state message.
The Typography component is appropriately used with good styling choices for the empty state message.
<img src={Placeholder} alt="Placeholder" | ||
style={{width: "150px", | ||
height:"auto", | ||
marginTop: theme.spacing(4), | ||
marginBottom:theme.spacing(4)}} /> | ||
<Typography variant="body2" color="text.secondary" style={{marginTop: theme.spacing(4)}}> | ||
There is currently no data in this table | ||
</Typography> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider improving accessibility for the empty state.
The empty state could be more accessible to screen readers.
Apply these improvements:
- <img src={Placeholder} alt="Placeholder"
+ <img
+ src={Placeholder}
+ alt="Empty table illustration"
style={{
width: "150px",
height: "auto",
marginTop: theme.spacing(4),
marginBottom: theme.spacing(4),
}}
/>
<Typography
+ role="status"
+ aria-live="polite"
variant="body2"
color="text.secondary"
style={{marginTop: theme.spacing(4)}}
>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<img src={Placeholder} alt="Placeholder" | |
style={{width: "150px", | |
height:"auto", | |
marginTop: theme.spacing(4), | |
marginBottom:theme.spacing(4)}} /> | |
<Typography variant="body2" color="text.secondary" style={{marginTop: theme.spacing(4)}}> | |
There is currently no data in this table | |
</Typography> | |
<img | |
src={Placeholder} | |
alt="Empty table illustration" | |
style={{ | |
width: "150px", | |
height: "auto", | |
marginTop: theme.spacing(4), | |
marginBottom: theme.spacing(4), | |
}} | |
/> | |
<Typography | |
role="status" | |
aria-live="polite" | |
variant="body2" | |
color="text.secondary" | |
style={{marginTop: theme.spacing(4)}} | |
> | |
There is currently no data in this table | |
</Typography> |
Summary by CodeRabbit
New Features
TableWithPlaceholder
component to display a message when no data is available, improving user feedback.Style