You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
539 B
19 lines
539 B
import { Component } from "@/typings/component";
|
|
import { CircularProgress } from "@nextui-org/progress";
|
|
import { useVisibility } from "reactjs-visibility";
|
|
|
|
export const Loading: Component<{
|
|
isFetching: boolean;
|
|
onVisible: (visiblity: boolean) => void;
|
|
}> = ({ onVisible, isFetching }) => {
|
|
const { ref } = useVisibility({
|
|
onChangeVisibility: onVisible
|
|
});
|
|
|
|
return (
|
|
<div ref={ref} className="flex items-center justify-center min-h-10">
|
|
{isFetching && <CircularProgress aria-label="Loading more items..." />}
|
|
</div>
|
|
);
|
|
};
|