\n {showPlaceholder && (placeholder || placeholderClassName) && (\n
\n {typeof placeholder === \"string\" ? (\n useNumericDimensions ? (\n
\n ) : (\n
\n )\n ) : placeholder ? (\n placeholder\n ) : placeholderClassName ? (\n
\n ) : null}\n
\n )}\n {error && !showPlaceholder && (\n
\n
\n
Error loading scene
\n
{error.message}
\n
\n
\n )}\n
\n >\n );\n}\n\nexport default UnicornScene;\nexport { UnicornScene };\n\n// Re-export types for convenience\nexport type { UnicornSceneProps } from \"../shared/types\";\n","import { useState, useCallback, useEffect } from \"react\";\n\n/**\n * Hook for managing the Unicorn Studio SDK script state in Next.js applications.\n *\n * @remarks\n * This hook is designed to work with Next.js's `Script` component.\n * Unlike the React version, it doesn't load the script itself - instead it provides\n * callbacks (`handleScriptLoad` and `handleScriptError`) to be passed to the\n * Next.js `Script` component's `onLoad` and `onError` props.\n *\n * The hook also checks if `window.UnicornStudio` is already available on mount,\n * handling cases where the script was loaded by a previous page navigation.\n *\n * @returns An object containing loading state, error state, and event handlers\n *\n * @example\n * ```tsx\n * import Script from \"next/script\";\n *\n * function MyComponent() {\n * const { isLoaded, error, handleScriptLoad, handleScriptError } = useUnicornStudioScript();\n *\n * return (\n * <>\n * \n * {isLoaded &&