import { useState } from "react";
import logo from './logo.svg';
import { SSX } from '@spruceid/ssx';
import './App.css';
import getSSXConfig from './ssx.config';
function AccountInfo({ address, delegator }: { address: string, delegator?: string }) {
return (
Account Info
{
address &&
Address
{address}
}
);
};
function App() {
const [ssxProvider, setSSX] = useState(null);
const ssxHandler = async () => {
const ssxConfig = await getSSXConfig();
const ssx = new SSX(ssxConfig);
await ssx.signIn();
setSSX(ssx);
(window as any).ssx = ssx;
};
const ssxLogoutHandler = async () => {
ssxProvider?.signOut();
setSSX(null);
};
return (
SSX
SSX Example Dapp
Connect and sign in with your Ethereum account
{
ssxProvider ?
<>
> :
}
);
}
export default App;