({ sessionToken })
| 12 | } |
| 13 | |
| 14 | export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => { |
| 15 | const clipboardState = useClipboard(); |
| 16 | return ( |
| 17 | <SignInLayout> |
| 18 | <Welcome>Session token</Welcome> |
| 19 | |
| 20 | <p className="m-0 text-center text-sm text-content-secondary leading-normal"> |
| 21 | Copy the session token below and{" "} |
| 22 | <strong className="block">paste it in your terminal.</strong> |
| 23 | </p> |
| 24 | |
| 25 | <div className="flex flex-col items-center gap-1 w-full mt-4"> |
| 26 | <Button |
| 27 | className="w-full" |
| 28 | size="lg" |
| 29 | disabled={!sessionToken} |
| 30 | onClick={() => { |
| 31 | if (sessionToken) { |
| 32 | clipboardState.copyToClipboard(sessionToken); |
| 33 | } |
| 34 | }} |
| 35 | > |
| 36 | {clipboardState.showCopiedSuccess ? ( |
| 37 | <CheckIcon /> |
| 38 | ) : ( |
| 39 | <Spinner loading={!sessionToken}> |
| 40 | <CopyIcon /> |
| 41 | </Spinner> |
| 42 | )} |
| 43 | {clipboardState.showCopiedSuccess |
| 44 | ? "Session token copied!" |
| 45 | : "Copy session token"} |
| 46 | </Button> |
| 47 | |
| 48 | <Button className="w-full" variant="subtle" asChild> |
| 49 | <RouterLink to="/workspaces">Go to workspaces</RouterLink> |
| 50 | </Button> |
| 51 | </div> |
| 52 | </SignInLayout> |
| 53 | ); |
| 54 | }; |
nothing calls this directly
no test coverage detected