2022-02-02 13:00:33 +00:00
|
|
|
import * as React from "react";
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
|
|
|
import { PairingTypes } from "@walletconnect/types";
|
|
|
|
|
|
|
|
import Peer from "./Peer";
|
|
|
|
|
|
|
|
interface PairingProps {
|
2022-05-30 09:46:15 +00:00
|
|
|
pairing: PairingTypes.Struct;
|
2022-02-02 13:00:33 +00:00
|
|
|
onClick?: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
const SPairingContainer = styled.div`
|
|
|
|
width: 100%;
|
|
|
|
cursor: pointer;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Pairing = (props: PairingProps) => {
|
2022-05-30 09:46:15 +00:00
|
|
|
const { peerMetadata } = props.pairing;
|
2022-02-02 13:00:33 +00:00
|
|
|
return (
|
|
|
|
<SPairingContainer onClick={props.onClick}>
|
|
|
|
<div>
|
2022-05-30 09:46:15 +00:00
|
|
|
{typeof peerMetadata !== "undefined" ? (
|
|
|
|
<Peer oneLiner metadata={peerMetadata} />
|
2022-02-02 13:00:33 +00:00
|
|
|
) : (
|
2022-05-30 09:46:15 +00:00
|
|
|
<div>{`Unknown Wallet`}</div>
|
2022-02-02 13:00:33 +00:00
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</SPairingContainer>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Pairing;
|