mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
28 lines
708 B
TypeScript
28 lines
708 B
TypeScript
'use client';
|
|
|
|
import { ThreeCircles, ThreeDots } from 'react-loader-spinner';
|
|
|
|
import { useConceptOptions } from '@/context/ConceptOptionsContext';
|
|
|
|
import AnimateFade from '../wrap/AnimateFade';
|
|
|
|
interface LoaderProps {
|
|
size?: number;
|
|
circular?: boolean;
|
|
}
|
|
|
|
function Loader({ size = 10, circular }: LoaderProps) {
|
|
const { colors } = useConceptOptions();
|
|
return (
|
|
<AnimateFade noFadeIn className='flex justify-center'>
|
|
{circular ? (
|
|
<ThreeCircles color={colors.bgPrimary} height={size * 10} width={size * 10} />
|
|
) : (
|
|
<ThreeDots color={colors.bgPrimary} height={size * 10} width={size * 10} radius={size} />
|
|
)}
|
|
</AnimateFade>
|
|
);
|
|
}
|
|
|
|
export default Loader;
|