/**
 * Shared formatting utilities for display purposes
 */

/**
 * Format a date string for display
 * @param dateStr - Date string in YYYY-MM-DD format
 */
export function formatDate(dateStr: string): string {
	const date = new Date(dateStr + 'T00:00:00');
	return date.toLocaleDateString('en-US', {
		weekday: 'long',
		month: 'long',
		day: 'numeric',
		year: 'numeric'
	});
}

/**
 * Format a status enum value for display
 * @param status - Status string like "IN_PROGRESS"
 * @returns Formatted string like "In Progress"
 */
export function formatStatus(status: string): string {
	return status.replace('_', ' ');
}

/**
 * Get the CSS class for a status badge
 * @param status - Status string
 */
export function getStatusBadgeClass(status: string): string {
	switch (status) {
		case 'SCHEDULED':
			return 'badge-primary';
		case 'IN_PROGRESS':
			return 'badge-accent';
		case 'COMPLETED':
			return 'badge-secondary';
		default:
			return 'bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200';
	}
}
