import React, { useState } from "react"; import { Button, Text } from "rimble-ui"; import { ModalContent, ModalHeader } from "../../../elements/Modals"; import { SchemaDataResponse } from "../../Schemas"; import { SchemasTable } from "../../Schemas/SchemasTable"; import { IssueVcForm } from "./IssueVcForm"; import { Identifier } from "../../../../types"; import { hexEllipsis } from "../../../../utils"; export interface IssueVcProps { identifiers: Identifier[]; subjectIdentifier?: Identifier; onComplete(): void; } export const IssueVcFlow: React.FunctionComponent = (props) => { const [schema, setSchema] = useState(); function goBack() { setSchema(undefined); } if (typeof schema === "undefined") { let subjectName = ""; if (props.subjectIdentifier) { const identifier = props.subjectIdentifier; if (identifier.alias && identifier.userName) { subjectName = `${identifier.alias} (${identifier.userName} - ${hexEllipsis(identifier.did)})`; } else if (identifier.alias || identifier.userName) { subjectName = `${identifier.alias || identifier.userName} (${hexEllipsis(identifier.did)})`; } else { subjectName = identifier.did; } } return ( <> Issue Credential {subjectName && ( Issuing credential about {subjectName}. )} Please select a credential schema, or{" "} setSchema(null)}> enter credential as JSON . {/* we'll use something like these tabs again when we have e.g. MRU schemas from agent , }, { tabName: "discover", title: "Discover", content: , }, ]} onTabClicked={setSchemaTab} /> */} ); } return ( ); };