261020_02_FIX: 짧은 비동기 작업 종료 시 리스트 및 배정 목록이 갱신되지 않는 오류 수정

This commit is contained in:
2026-10-20 11:57:46 +09:00
parent 8f0de91e93
commit d2e214696d
6 changed files with 173 additions and 22 deletions

View File

@@ -0,0 +1,22 @@
'use client'
import { Button } from '@/components/ui/button'
import type { ListJobPageMonitor } from '@/hooks/useListJobPageMonitor'
export function ListJobRefreshNotice({ monitor, clearsSelection = false }: {
monitor: ListJobPageMonitor
clearsSelection?: boolean
}) {
if (!monitor.pendingRefresh) return null
return (
<div role="status" className="flex items-center justify-between gap-3 rounded-md border bg-muted/30 p-3 text-sm">
<p>{monitor.refreshError ? '목록을 새로 불러오지 못했습니다. 다시 시도해 주세요.'
: clearsSelection ? '목록이 변경되었습니다. 새로고침하면 선택한 행이 해제됩니다.'
: '목록이 변경되었습니다. 작업을 마친 뒤 새로고침해 주세요.'}</p>
<Button type="button" variant="outline" size="sm" disabled={monitor.refreshBlocked || monitor.refreshing}
onClick={() => void monitor.refresh()}>
{monitor.refreshing ? '새로고침 중…' : '새로고침'}
</Button>
</div>
)
}