({ activeOrder }: PremiumStatusProps)
| 71 | } |
| 72 | |
| 73 | function PremiumStatus({ activeOrder }: PremiumStatusProps) { |
| 74 | const t = useTranslations("Pricing"); |
| 75 | const status = activeOrder?.status; |
| 76 | const renewsAt = activeOrder?.renews_at; |
| 77 | const endsAt = activeOrder?.ends_at; |
| 78 | const text: MessageKey = status === "active" ? "renew_display_prefix" : "expired_display_prefix"; |
| 79 | const date = status === "active" ? renewsAt : endsAt; |
| 80 | |
| 81 | if (!activeOrder || !date) { |
| 82 | return null; |
| 83 | } |
| 84 | |
| 85 | return ( |
| 86 | <span className="flex gap-1"> |
| 87 | <Typography affects="muted">{t(text)}</Typography> |
| 88 | <Typography>{dateToYYYYMMDD(date)}</Typography> |
| 89 | </span> |
| 90 | ); |
| 91 | } |
nothing calls this directly
no test coverage detected