import { DefaultButton, PrimaryButton, Spinner, Stack, Text, TextField } from "@fluentui/react"; import copyToClipboard from "clipboard-copy"; import * as React from "react"; import { useFullScreenURLs } from "../hooks/useFullScreenURLs"; export const OpenFullScreen: React.FunctionComponent = () => { const [isReadUrlCopy, setIsReadUrlCopy] = React.useState(false); const [isReadWriteUrlCopy, setIsReadWriteUrlCopy] = React.useState(false); const result = useFullScreenURLs(); if (!result) { return ; } const readWriteUrl = `https://cosmos.azure.com/?key=${result.readWrite}`; const readUrl = `https://cosmos.azure.com/?key=${result.read}`; return ( <> Open this database account in a new browser tab with Cosmos DB Explorer. Or copy the read-write or read only access urls below to share with others. For security purposes, the URLs grant time-bound access to the account. When access expires, you can reconnect, using a valid connection string for the account. { copyToClipboard(readWriteUrl); setIsReadWriteUrlCopy(true); }} text={isReadWriteUrlCopy ? "Copied" : "Copy"} iconProps={{ iconName: "Copy" }} /> { window.open(readWriteUrl, "_blank"); }} text="Open" iconProps={{ iconName: "OpenInNewWindow" }} /> { setIsReadUrlCopy(true); copyToClipboard(readUrl); }} text={isReadUrlCopy ? "Copied" : "Copy"} iconProps={{ iconName: "Copy" }} /> { window.open(readUrl, "_blank"); }} text="Open" iconProps={{ iconName: "OpenInNewWindow" }} /> ); };