import React from 'react';

export const useTimeFormats = () => {
  const generateDelta = (diff: number) => {
    let string =
      Math.floor(diff / 60) >= 1
        ? `${Math.floor(diff / 60)}h ${diff % 60 > 0 ? `${diff % 60}min` : ''}`
        : `${diff % 60 > 0 ? `${diff % 60}min` : ''}`;
    return string;
  };

  return { generateDelta };
};
