-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathServiceOffered.tsx
More file actions
40 lines (35 loc) · 1.07 KB
/
ServiceOffered.tsx
File metadata and controls
40 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Badge } from '@filecoin-foundation/ui-filecoin/Badge'
import {
getServiceTier,
SERVICE_TIER_LABELS,
ServiceTier,
} from '@/utils/service-tier'
type ServiceOfferedProps = {
isActive: boolean
isApproved: boolean
}
export function ServiceOffered({ isActive, isApproved }: ServiceOfferedProps) {
const serviceTier = getServiceTier(isActive, isApproved)
const labelTextTransform = 'none'
if (serviceTier === ServiceTier.INACTIVE) {
return (
<div className="py-4 flex flex-col items-start">
<Badge textTransform={labelTextTransform} variant="tertiary">
{SERVICE_TIER_LABELS[ServiceTier.INACTIVE]}
</Badge>
</div>
)
}
return (
<div className="py-4 flex flex-col gap-2 items-start">
{serviceTier === ServiceTier.WARM_AND_PDP && (
<Badge textTransform={labelTextTransform} variant="secondary">
{SERVICE_TIER_LABELS[ServiceTier.WARM_AND_PDP]}
</Badge>
)}
<Badge textTransform={labelTextTransform}>
{SERVICE_TIER_LABELS[ServiceTier.PDP_ONLY]}
</Badge>
</div>
)
}