import React from 'react'
const convertTimeToHourMinuteFormat = timeInHours => {
var hours = Math.trunc(timeInHours / 60);
var minutes = timeInHours % 60;
return `${hours}h ${minutes}m`
}
export const getSeasonsOrMovieLength = (seasons, runtime) => {
let timeSpan
if (runtime) {
timeSpan = {convertTimeToHourMinuteFormat(runtime)}
} else if (seasons) {
timeSpan = (
{seasons.length > 1 ? `${seasons.length} Seasons` : `${seasons.length} Season`}
)
}
return timeSpan
}