mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Add data library UI
This commit is contained in:
28
frontend/src/components/SourceBadge.tsx
Normal file
28
frontend/src/components/SourceBadge.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
type Source = 'local' | 'partial' | 'none'
|
||||
|
||||
interface Props {
|
||||
source: Source
|
||||
label?: string
|
||||
}
|
||||
|
||||
export function SourceBadge({ source, label }: Props) {
|
||||
switch (source) {
|
||||
case 'local':
|
||||
return <span className="badge badge-local">{label ?? 'Local'}</span>
|
||||
case 'partial':
|
||||
return <span className="badge badge-partial">{label ?? 'Partial'}</span>
|
||||
default:
|
||||
return <span className="badge badge-none">{label ?? 'None'}</span>
|
||||
}
|
||||
}
|
||||
|
||||
export function weekendStatusLabel(source: Source): string {
|
||||
switch (source) {
|
||||
case 'local':
|
||||
return 'Full'
|
||||
case 'partial':
|
||||
return 'Partial'
|
||||
default:
|
||||
return 'Missing'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user