Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useEffect, useState } from 'react';

import { formatTimeAgo } from '@/lib/formatDateTime';
import { GetGroupDetailsResponse } from '@/types/service/group';

Expand All @@ -13,8 +15,13 @@ export const DescriptionProgress = ({
progress: { maxParticipants, participantCount },
createdAt,
}: Props) => {
const [timeAgo, setTimeAgo] = useState<string | null>(null);
const progressRate = Math.ceil((participantCount / maxParticipants) * 100);

useEffect(() => {
setTimeAgo(formatTimeAgo(createdAt));
}, [createdAt]);

return (
<div className='mt-6 select-none'>
<div className='space-y-1 rounded-2xl border border-gray-300 bg-gray-50 px-4 py-[14px]'>
Expand All @@ -30,7 +37,7 @@ export const DescriptionProgress = ({
</div>

<div className='mt-4'>
<p className='text-text-xs-medium text-right text-gray-500'>{formatTimeAgo(createdAt)}</p>
<p className='text-text-xs-medium h-4.5 text-right text-gray-500'>{timeAgo}</p>
</div>
</div>
);
Expand Down