import { CircularProgress, IconButton } from "@mui/material"
import EventRepeatIcon from "@mui/icons-material/EventRepeat"

export default function RefreshIcon({ isLoading, handler }: { isLoading: boolean; handler: () => void }) {
  return (
    <IconButton color={"primary"} onClick={handler}>
      {isLoading ? <CircularProgress size={24} /> : <EventRepeatIcon />}
    </IconButton>
  )
}
