"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useYouTubeIframeApi = void 0;
const react_1 = require("react");
const YouTubeIframeApiLoader_1 = require("./YouTubeIframeApiLoader");
function useYouTubeIframeApi() {
    const [YT, setYT] = (0, react_1.useState)(undefined);
    (0, react_1.useEffect)(() => {
        const loader = YouTubeIframeApiLoader_1.YouTubeIframeApiLoader.create();
        loader.getApi().then((YT) => setYT(YT));
    }, []);
    return YT;
}
exports.useYouTubeIframeApi = useYouTubeIframeApi;
