{ "type": "composition", "npmDependencies": [], "fileDependencies": [], "id": "loading-overlay", "file": { "name": "loading-overlay.tsx", "content": "\"use client\"\n\nimport { AbsoluteCenter, Box, type BoxProps, Spinner } from \"@chakra-ui/react\"\nimport { useEffect } from \"react\"\n\ninterface LoadingOverlayProps extends BoxProps {\n loading?: boolean\n containerRef?: React.RefObject\n}\n\nexport const LoadingOverlay = (props: LoadingOverlayProps) => {\n const { loading, containerRef, children, ...rest } = props\n\n useEffect(() => {\n if (!containerRef?.current) return\n if (loading) {\n containerRef.current.setAttribute(\"aria-busy\", \"true\")\n } else {\n containerRef.current.removeAttribute(\"aria-busy\")\n }\n }, [loading])\n\n if (!loading) return null\n\n return (\n \n \n \n {children}\n \n )\n}\n" }, "component": "LoadingOverlay" }