{"size": 1079, "ext": "js", "max_stars_repo_path": "bootstrap/src/index.js", "max_stars_repo_name": "runlyio/js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "bootstrap/src/index.js", "max_issues_repo_name": "runlyio/js", "max_issues_repo_issues_event_min_datetime": "2020-04-01T20:11:32.000Z", "max_issues_repo_issues_event_max_datetime": "2020-04-07T20:38:40.000Z", "max_forks_repo_path": "bootstrap/src/index.js", "max_forks_repo_name": "runlyio/js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 22.4791666667, "max_line_length": 88, "alphanum_fraction": 0.6607970343}
import React, { useEffect, useState } from "react";
import Helmet from "react-helmet";

export { RunlyProvider } from "@runly/ui";

export { default as RunProgress } from "./progress";
export { default as OrgChooser } from "./org-chooser";

const bs4test = () => {
	let result = null;

	if (document) {
		const el = document.createElement("div");

		el.setAttribute("style", "display: block;");
		el.setAttribute("class", "d-inline");

		document.body.appendChild(el);
		result = window.getComputedStyle(el).display === "inline";
		document.body.removeChild(el);
	}

	return result;
};

export const BootstrapStyles = () => {
	const [hasBs4, setHasBs4] = useState(null);
	useEffect(() => {
		if (hasBs4 === null) {
			setHasBs4(bs4test());
		}
	}, [hasBs4]);

	if (!hasBs4) {
		return (
			<Helmet>
				<link
					rel="stylesheet"
					href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
					integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
					crossOrigin="anonymous"
				/>
			</Helmet>
		);
	}
	return null;
};
