import React, { useState, useEffect } from 'react'; import type { DeckViewerProps } from '../types/slidev'; import styles from '../styles/slidev-controls.module.css'; /** * DeckViewer Component (Optional) * * Displays the Slidev deck in an iframe for embedded viewing. * Can be used to show the presentation inline within the demo experience UI. * * Usage: * ```tsx * * ``` */ export const DeckViewer: React.FC = ({ deckUrl, deckId }) => { const [isLoading, setIsLoading] = useState(true); const [hasError, setHasError] = useState(false); useEffect(() => { // Reset loading state when URL changes setIsLoading(true); setHasError(false); }, [deckUrl]); const handleLoad = () => { setIsLoading(false); }; const handleError = () => { setIsLoading(false); setHasError(true); }; return (
{isLoading && (
Loading presentation...
)} {hasError && (
Failed to load presentation. Please try opening it in a new window.
Open in New Window
)}