/* eslint-disable @typescript-eslint/restrict-plus-operands */ /* eslint-disable @typescript-eslint/indent */ import { Icon } from '@iconify/react/dist/iconify.js' import React, { useState } from 'react' import HoursAndMinutesFromSeconds from './HoursAndMinutesFromSeconds' import useFetch from '../../../hooks/useFetch' import APIComponentWithFallback from '../../../components/general/APIComponentWithFallback' function CodeTimeMostProjects(): React.ReactElement { const [lastForProjects, setLastForProjects] = useState< '24 hours' | '7 days' | '30 days' >('24 hours') const [topProjects] = useFetch>( `code-time/projects?last=${lastForProjects}` ) return (

Projects You've Spent Most Time Doing

in the last

{['24 hours', '7 days', '30 days'].map((last, index) => ( ))}
{typeof topProjects !== 'string' && Object.keys(topProjects).length > 0 && Object.entries(topProjects) .slice(0, 5) .map(([key, value], index) => (
a + b[1], 0)) * 100 )}%` }} >
))}
    {topProjects !== null && Object.keys(topProjects).length > 0 && Object.entries(topProjects) .slice(0, 5) .map(([key, value], index) => (
  • {key}
  • ))}
) } export default CodeTimeMostProjects