import { RepeatIcon } from "@chakra-ui/icons";
import { IconButton } from "@chakra-ui/react";

export interface DataTableLoaderProps {
  isLoading: boolean;
  refetch: () => void;
}

export const DataTableLoader = ({ isLoading, refetch }: DataTableLoaderProps) => (
  <IconButton
    size="sm"
    aria-label="Loading"
    icon={<RepeatIcon />}
    isLoading={isLoading}
    onClick={refetch}
    position="absolute"
    top="5px"
    right="5px"
    rounded="lg"
  />
);
