import { Spin } from "antd";
import { useTheme } from "hooks";
import { FC } from "react";
import * as S from "./style";
interface FullsizeSpinnerContainerProps {
text?: string;
}
const FullsizeSpinnerContainer: FC<FullsizeSpinnerContainerProps> = ({
text,
children,
}) => {
return <S.FullScreenSpinner>{children}</S.FullScreenSpinner>;
};
const FullSizeSpinner = ({
size,
theme,
}: {
size: "small" | "default" | "large" | undefined;
theme?: string;
}) => {
const { currentTheme } = useTheme();
return (
<FullsizeSpinnerContainer>
<Spin size={size} style={{ color: currentTheme }} />
</FullsizeSpinnerContainer>
);
};
export { FullSizeSpinner };
antd로 간단하게 spinner 활용
{dataFetching && }
데이터 fetching시 spinner를 활용