File size: 1,312 Bytes
cd6f98e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from "react";

import { useAuth } from "../../hooks/useAuth";
import Dialog from "../../ui/dialog";

export interface SignInDialogProps {
  show: boolean;
  setOpen: (boolean) => void;
}

export const SignInDialog = ({ show, setOpen }: SignInDialogProps) => {
  const { signIn } = useAuth();

  return (
    <Dialog
      inline
      open={show}
      setOpen={setOpen}
      title="Sign in 🔐"
      actions={
        <>
          <button
            type="button"
            className="inline-flex w-full justify-center rounded-md bg-sky-500 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-400"
            onClick={() => {
              signIn().catch(console.error);
            }}
          >
            Sign in
          </button>
          <button
            type="button"
            className="inline-flex w-full justify-center rounded-md bg-slate-1 px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-slate-3"
            onClick={() => setOpen(false)}
          >
            Close
          </button>
        </>
      }
    >
      <p>
        Please{" "}
        <a className="link" onClick={() => void signIn()}>
          sign in
        </a>{" "}
        to deploy an Agent! 🤖
      </p>
    </Dialog>
  );
};