RefreshButton.tsx 687 B

12345678910111213141516171819202122232425262728
  1. import { LoaderCircle, RefreshCcw } from 'lucide-react'
  2. import { ButtonTooltip } from '../ButtonTooltip'
  3. interface RefreshButtonProps {
  4. isLoading: boolean
  5. onRefresh: () => void
  6. }
  7. export const RefreshButton = ({ isLoading, onRefresh }: RefreshButtonProps) => {
  8. return (
  9. <ButtonTooltip
  10. size="tiny"
  11. type="default"
  12. disabled={isLoading}
  13. onClick={onRefresh}
  14. className="w-[26px]"
  15. icon={
  16. isLoading ? (
  17. <LoaderCircle className="text-foreground animate-spin" />
  18. ) : (
  19. <RefreshCcw className="text-foreground" />
  20. )
  21. }
  22. tooltip={{ content: { side: 'bottom', text: 'Refresh logs' } }}
  23. />
  24. )
  25. }