Frontend update
This commit is contained in:
27
client/src/components/PageState.jsx
Normal file
27
client/src/components/PageState.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
// Consistent loading / error / empty states for data-driven sections.
|
||||
export function Loading({ label = 'Loading…' }) {
|
||||
return (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12, color: 'var(--muted)', padding: '24px 0' }}>
|
||||
<span className="spin" /> {label}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function ErrorState({ message = 'Something went wrong.' }) {
|
||||
return (
|
||||
<div className="note" style={{ borderLeftColor: '#b4665f' }}>
|
||||
{message}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function EmptyState({ children }) {
|
||||
return (
|
||||
<div
|
||||
className="panel"
|
||||
style={{ padding: '28px', color: 'var(--muted)', textAlign: 'center', fontFamily: 'var(--sans)', fontSize: '0.95rem' }}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user