Skip to content

Commit ca89b81

Browse files
committed
fix(components): add type to res.json()
1 parent a068045 commit ca89b81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/www/src/app/(main)/_components/CodingHours/CodingHours.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ export const CodingHours = async () => {
1212

1313
const {
1414
data: { total_seconds },
15-
} = await res.json();
15+
} = (await res.json()) as { data: { total_seconds: number } };
1616

1717
const roundedSeconds = Math.round(total_seconds);
1818
const hours = Math.floor(roundedSeconds / 3600).toLocaleString();
1919
const remainingSeconds = roundedSeconds % 3600;
2020
const minutes = Math.floor(remainingSeconds / 60);
2121

2222
return (
23-
<div className='space-y-2 px-8'>
23+
<div className='space-y-4 p-8'>
2424
<h4 className='font-serif text-lg text-grey-text'>Coding hours</h4>
2525
<p className='text-3xl font-medium'>
2626
{hours} hrs {minutes} mins

0 commit comments

Comments
 (0)