announce notification panel loading state
This commit is contained in:
@@ -13,7 +13,7 @@ function Queue({weekly}){
|
||||
const load=async()=>{const data=await accountRequest(endpoint);const rows=requireArray(data,'deliveries');if(alive.current)setRows(rows);};
|
||||
const act=async fn=>{if(locked.current)return;locked.current=true;setBusy(true);setError(null);try{await fn();}catch(e){if(alive.current)setError(e.message);}finally{locked.current=false;if(alive.current)setBusy(false);}};
|
||||
useEffect(()=>{alive.current=true;void act(load);return()=>{alive.current=false;};},[]);
|
||||
return <section aria-label={weekly?'Haftalık özet gönderim incelemesi':'E-posta gönderim incelemesi'} className="bg-white border rounded-xl p-5 space-y-3">
|
||||
return <section role="region" aria-label={weekly?'Haftalık özet gönderim incelemesi':'E-posta gönderim incelemesi'} aria-busy={busy} className="bg-white border rounded-xl p-5 space-y-3">
|
||||
<h3 className="font-bold">{weekly?'Haftalık özet gönderim incelemesi':'E-posta gönderim incelemesi'} · Yönetici</h3>
|
||||
<p className="text-sm">{weekly?'Haftalık özetin bekleyen mesajları ve inceleme kararları gösterilir.':'Bekleyen işler ve son inceleme kararları gösterilir (en fazla 50).'} Belirsiz gönderimi sağlayıcı kaydıyla karşılaştırın. Bu işlemler yeni mesaj göndermez.</p>
|
||||
<button type="button" disabled={busy} onClick={()=>act(load)} className="border rounded px-3 py-2">Gönderim listesini yenile</button>
|
||||
|
||||
@@ -37,7 +37,7 @@ const TelegramPanel = ({isAdmin}) => {
|
||||
};
|
||||
useEffect(()=>{alive.current=true;void calistir('load',yenile);return()=>{alive.current=false;};},[]);
|
||||
|
||||
if(!d)return <section className="bg-white border rounded-xl p-5 space-y-3" aria-label="Telegram bağlantı durumu">
|
||||
if(!d)return <section role="region" className="bg-white border rounded-xl p-5 space-y-3" aria-label="Telegram bağlantı durumu" aria-busy={!!busy}>
|
||||
<h3 className="font-bold text-sm">Telegram Bildirimi</h3>
|
||||
{busy&&<p role="status" className="text-sm">Bağlantı durumu yükleniyor…</p>}
|
||||
{mesaj&&<p role="alert" className="text-red-700 text-sm">{mesaj.metin}</p>}
|
||||
@@ -45,7 +45,7 @@ const TelegramPanel = ({isAdmin}) => {
|
||||
</section>;
|
||||
|
||||
return (
|
||||
<div className="bg-white p-6 rounded-2xl border border-slate-200 shadow-xs space-y-4">
|
||||
<div role="region" aria-label="Telegram bağlantı ayarları" aria-busy={!!busy} className="bg-white p-6 rounded-2xl border border-slate-200 shadow-xs space-y-4">
|
||||
<div className="flex items-center justify-between border-b border-slate-100 pb-3">
|
||||
<h3 className="font-extrabold text-sm text-slate-900 flex items-center gap-2">
|
||||
<Send className="w-4 h-4 text-sky-600" /> Telegram Bildirimi
|
||||
|
||||
Reference in New Issue
Block a user