add doctor feedback

This commit is contained in:
Danel Kungla
2025-10-28 16:09:06 +02:00
parent b5b01648fc
commit 8bc6089a7f
28 changed files with 820 additions and 95 deletions

View File

@@ -1,3 +1,4 @@
import { AnalysisResponses } from '@/app/home/(user)/_components/ai/types';
import { type ClassValue, clsx } from 'clsx';
import Isikukood, { Gender } from 'isikukood';
import { twMerge } from 'tailwind-merge';
@@ -148,3 +149,17 @@ export const findProductTypeIdByHandle = (
) => {
return productTypes.find(({ metadata }) => metadata?.handle === handle)?.id;
};
export function getLatestResponseTime(items?: AnalysisResponses) {
if (!items?.length) return new Date().toISOString();
let latest = null;
for (const it of items) {
const d = new Date(it.response_time);
const t = d.getTime();
if (!Number.isNaN(t) && (latest === null || t > latest.getTime())) {
latest = d;
}
}
return latest ? new Date(latest).toISOString() : new Date().toISOString();
}