feat(MED-105): show analysis date in tooltip for now

This commit is contained in:
2025-08-11 09:21:33 +03:00
parent 37f233e363
commit 556d7bd321
4 changed files with 20 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
'use client';
import React, { useState } from 'react';
import { format } from 'date-fns';
import { Info } from 'lucide-react';
@@ -61,21 +62,23 @@ const Analysis = ({
<div className="border-border items-center justify-between rounded-lg border px-5 py-3 sm:h-[65px] flex flex-col sm:flex-row px-12 gap-2 sm:gap-0">
<div className="flex items-center gap-2 font-semibold">
{name}
<div
className="group/tooltip relative"
onClick={() => setShowTooltip(!showTooltip)}
onMouseLeave={() => setShowTooltip(false)}
>
<Info className="hover" />{' '}
{results?.response_time && (
<div
className={cn(
'absolute bottom-full left-1/2 z-10 mb-2 hidden -translate-x-1/2 rounded border bg-white p-4 text-sm whitespace-nowrap group-hover/tooltip:block',
{ block: showTooltip },
)}
className="group/tooltip relative"
onClick={() => setShowTooltip(!showTooltip)}
onMouseLeave={() => setShowTooltip(false)}
>
This text changes when you hover the box above.
<Info className="hover" />{' '}
<div
className={cn(
'absolute bottom-full left-1/2 z-10 mb-2 hidden -translate-x-1/2 rounded border bg-white p-4 text-sm whitespace-nowrap group-hover/tooltip:block',
{ block: showTooltip },
)}
>
<Trans i18nKey="analysis-results:analysisDate" />{': '}{format(new Date(results.response_time), 'dd.MM.yyyy HH:mm')}
</div>
</div>
</div>
)}
</div>
{results ? (
<>