\n {showPlaceholder && (placeholder || placeholderClassName) && (\n
\n {typeof placeholder === \"string\" ? (\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\nexport default UnicornScene;\nexport { UnicornScene };\n\n// Re-export types for convenience\nexport type { UnicornSceneProps } from \"../shared/types\";\n","import { useEffect, useState, useCallback } from \"react\";\n\n/**\n * Hook for loading the Unicorn Studio SDK script in React applications.\n *\n * @remarks\n * This hook manages the lifecycle of the Unicorn Studio SDK script element.\n * It handles script loading, error states, and prevents duplicate script tags.\n * The script is loaded asynchronously and persists in the DOM to avoid re-loading on remount.\n *\n * @param scriptUrl - The URL of the Unicorn Studio SDK script to load\n * @returns An object containing loading state, error state, and event handlers\n *\n * @example\n * ```tsx\n * const { isLoaded, error } = useUnicornStudioScript(\n * \"https://cdn.jsdelivr.net/gh/hiunicornstudio/unicornstudio.js@v2.0.1/dist/unicornStudio.umd.js\"\n * );\n *\n * if (error) {\n * return Loading...
;\n * }\n * ```\n */\nexport function useUnicornStudioScript(scriptUrl: string): {\n /** Whether the script has finished loading successfully */\n isLoaded: boolean;\n /** Error that occurred during script loading, if any */\n error: Error | null;\n /** Callback to handle successful script load */\n handleScriptLoad: () => void;\n /** Callback to handle script loading error */\n handleScriptError: () => void;\n} {\n const [isLoaded, setIsLoaded] = useState(false);\n const [error, setError] = useState