/**
 * Status badge color/class configuration
 */

export interface StatusConfig {
	label: string;
	classes: string;
}

const STATUS_MAP: Record<string, StatusConfig> = {
	// Membership statuses
	active: { label: 'Active', classes: 'bg-green-100 text-green-800' },
	pending: { label: 'Pending', classes: 'bg-yellow-100 text-yellow-800' },
	inactive: { label: 'Inactive', classes: 'bg-slate-100 text-slate-800' },
	suspended: { label: 'Suspended', classes: 'bg-red-100 text-red-800' },

	// Dues statuses
	current: { label: 'Current', classes: 'bg-green-100 text-green-800' },
	due_soon: { label: 'Due Soon', classes: 'bg-yellow-100 text-yellow-800' },
	overdue: { label: 'Overdue', classes: 'bg-red-100 text-red-800' },
	never_paid: { label: 'Never Paid', classes: 'bg-slate-100 text-slate-800' },

	// Payment statuses
	paid: { label: 'Paid', classes: 'bg-green-100 text-green-800' },
	unpaid: { label: 'Unpaid', classes: 'bg-red-100 text-red-800' },
	partial: { label: 'Partial', classes: 'bg-yellow-100 text-yellow-800' },

	// RSVP statuses
	confirmed: { label: 'Confirmed', classes: 'bg-green-100 text-green-800' },
	declined: { label: 'Declined', classes: 'bg-red-100 text-red-800' },
	maybe: { label: 'Maybe', classes: 'bg-yellow-100 text-yellow-800' },
	waitlist: { label: 'Waitlist', classes: 'bg-blue-100 text-blue-800' },
	cancelled: { label: 'Cancelled', classes: 'bg-slate-100 text-slate-800' },

	// Event statuses
	published: { label: 'Published', classes: 'bg-green-100 text-green-800' },
	draft: { label: 'Draft', classes: 'bg-slate-100 text-slate-800' },

	// Roles
	admin: { label: 'Admin', classes: 'bg-purple-100 text-purple-800' },
	board: { label: 'Board', classes: 'bg-blue-100 text-blue-800' },
	member: { label: 'Member', classes: 'bg-slate-100 text-slate-800' }
};

export function getStatusConfig(status: string): StatusConfig {
	return STATUS_MAP[status] || { label: status, classes: 'bg-slate-100 text-slate-800' };
}

export function getStatusBadgeClasses(status: string): string {
	return getStatusConfig(status).classes;
}

export function getStatusLabel(status: string): string {
	return getStatusConfig(status).label;
}
