import g from "../shared/git-status.module.css";

/** Map git_status string to CSS class for status dot */
export function getStatusClass(status: string): string {
	switch (status) {
		case "modified":
			return g.modified;
		case "staged":
			return g.staged;
		case "untracked":
			return g.untracked;
		default:
			return "";
	}
}

/** Format file size for display */
export function formatSize(bytes: number): string {
	if (bytes === 0) return "";
	if (bytes < 1024) return `${bytes} B`;
	if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
	return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
}
