label stale exchange rates

This commit is contained in:
2026-09-06 16:43:58 +03:00
parent dfbcf4ce56
commit 764e325737
+3 -2
View File
@@ -47,6 +47,7 @@ export const TenderDetailModal = () => {
}, [activeTenderDetail?.id]); }, [activeTenderDetail?.id]);
const usdRate = fx?.rates?.USD; const usdRate = fx?.rates?.USD;
const eurRate = fx?.rates?.EUR; const eurRate = fx?.rates?.EUR;
const fxIsStale = Boolean(fx?.refreshError);
if (!activeTenderDetail) return null; if (!activeTenderDetail) return null;
// Havuzdaki güncel kayıt: takip/görev değişince düğme etiketleri de değişsin. // Havuzdaki güncel kayıt: takip/görev değişince düğme etiketleri de değişsin.
@@ -351,11 +352,11 @@ export const TenderDetailModal = () => {
<Calculator className="w-4 h-4 text-blue-400" /> Kur Farkı Hesaplayıcı <Calculator className="w-4 h-4 text-blue-400" /> Kur Farkı Hesaplayıcı
</span> </span>
<span className={`text-[10px] px-2 py-0.5 rounded font-bold ${fx ? 'bg-blue-500/30 text-blue-300' : 'bg-slate-500/30 text-slate-300'}`}> <span className={`text-[10px] px-2 py-0.5 rounded font-bold ${fx ? 'bg-blue-500/30 text-blue-300' : 'bg-slate-500/30 text-slate-300'}`}>
{fx ? 'TCMB döviz satış' : 'Kur verisi bekleniyor'} {!fx ? 'Kur verisi bekleniyor' : fxIsStale ? 'TCMB · yenileme başarısız' : 'TCMB döviz satış'}
</span> </span>
</div> </div>
{fx && <p className="text-[11px]"><a href={fx.source} target="_blank" rel="noreferrer" className="underline">TCMB bülteni: {fx.bulletinDate}</a> · Alındı: {new Date(fx.fetchedAt).toLocaleString('tr-TR')}</p>} {fx && <p className="text-[11px]"><a href={fx.source} target="_blank" rel="noreferrer" className="underline">TCMB bülteni: {fx.bulletinDate}</a> · Alındı: {new Date(fx.fetchedAt).toLocaleString('tr-TR')}{fxIsStale ? ' · Son başarılı veri; güncelleme başarısız' : ''}</p>}
{fxError && <p role="alert" className="text-xs text-amber-200">{fxError}</p>} {fxError && <p role="alert" className="text-xs text-amber-200">{fxError}</p>}
<div className="grid grid-cols-2 gap-2 text-xs font-semibold"> <div className="grid grid-cols-2 gap-2 text-xs font-semibold">
<div className="bg-white/10 p-2.5 rounded-lg border border-white/10"> <div className="bg-white/10 p-2.5 rounded-lg border border-white/10">