()
| 4 | import { useTransition } from 'react' |
| 5 | |
| 6 | export default function RefreshButton() { |
| 7 | const router = useRouter() |
| 8 | const [isPending, startTransition] = useTransition() |
| 9 | |
| 10 | return ( |
| 11 | <button |
| 12 | className={`${ |
| 13 | isPending ? 'cursor-not-allowed text-gray-400' : '' |
| 14 | } text-sm text-gray-500 hover:text-gray-900`} |
| 15 | disabled={isPending} |
| 16 | onClick={() => { |
| 17 | startTransition(() => { |
| 18 | router.refresh() |
| 19 | }) |
| 20 | }} |
| 21 | > |
| 22 | {isPending ? 'Refreshing...' : 'Refresh'} |
| 23 | </button> |
| 24 | ) |
| 25 | } |
nothing calls this directly
no outgoing calls
no test coverage detected