| 1 | import { Loader2, RotateCcw } from 'lucide-react' |
| 2 | |
| 3 | export function RetryFailedPagesButton({ |
| 4 | loading, |
| 5 | label, |
| 6 | loadingLabel, |
| 7 | onClick |
| 8 | }: { |
| 9 | loading: boolean |
| 10 | label: string |
| 11 | loadingLabel: string |
| 12 | onClick: () => void |
| 13 | }): React.JSX.Element { |
| 14 | return ( |
| 15 | <button |
| 16 | type="button" |
| 17 | disabled={loading} |
| 18 | onClick={onClick} |
| 19 | className="inline-flex h-9 items-center justify-center rounded-[10px] bg-[#5d6b4d] px-4 text-sm font-medium text-white transition-colors hover:bg-[#49563d] disabled:cursor-wait disabled:opacity-75" |
| 20 | > |
| 21 | {loading ? ( |
| 22 | <Loader2 className="mr-2 h-4 w-4 animate-spin" /> |
| 23 | ) : ( |
| 24 | <RotateCcw className="mr-2 h-4 w-4" /> |
| 25 | )} |
| 26 | {loading ? loadingLabel : label} |
| 27 | </button> |
| 28 | ) |
| 29 | } |
| 30 |