21 lines
954 B
TypeScript
21 lines
954 B
TypeScript
import { cn } from "@/lib/utils"
|
|||
|
|
|
||
|
|
type RentStatus = "pending" | "paid" | "overdue" | "partial" | "waived"
|
||
|
|
|
||
|
|
const config: Record<RentStatus, { label: string; className: string }> = {
|
||
|
|
paid: { label: "Paid", className: "text-emerald-400 bg-emerald-500/10 border-emerald-500/20" },
|
||
|
|
pending: { label: "Pending", className: "text-amber-400 bg-amber-500/10 border-amber-500/20" },
|
||
|
|
overdue: { label: "Overdue", className: "text-red-400 bg-red-500/10 border-red-500/20" },
|
||
|
|
partial: { label: "Partial", className: "text-blue-400 bg-blue-500/10 border-blue-500/20" },
|
||
|
|
waived: { label: "Waived", className: "text-white/40 bg-white/5 border-white/10" },
|
||
|
|
}
|
||
|
|
|
||
|
|
export function RentStatusBadge({ status }: { status: RentStatus }) {
|
||
|
|
const { label, className } = config[status] ?? config.pending
|
||
|
|
return (
|
||
|
|
<span className={cn("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium", className)}>
|
||
|
|
{label}
|
||
|
|
</span>
|
||
|
|
)
|
||
|
|
}
|