export function getTimeInMins(timeInSeconds: number) {
	const min = Math.floor(timeInSeconds / 60);
	const sec = timeInSeconds % 60;

	return {
		min: min,
		sec: Math.floor(sec),
		// biome-ignore format:
		full: `${timeInMins(min, false) ?? ""} ${sec > 0 ? ` ${Math.floor(sec)} sec` : ""}`,
		// biome-ignore format:
		fullShort: `${timeInMins(min, true) ?? ""} ${sec > 0 ? `${Math.floor(sec)}s` : ""}`,
	};
}

function timeInMins(time: number, short: boolean) {
	if (!time) return null;
	// biome-ignore format:
	if (short) return `${time}m`;
	// biome-ignore format:
	return `${time} ${time > 1 ? "mins" : "min"}`;
}
