import { useEffect, useState } from 'react'; import { getSchemaByName } from "@stirling-pdf/shared-operations/src/workflow/operatorAccessor"; import styles from './OperatorCard.module.css'; import { MaterialSymbol, MaterialSymbolProps } from 'react-material-symbols'; interface OperatorCardProps { /** The text to display inside the button */ operatorInternalName: string; } export function OperatorCard({ operatorInternalName }: OperatorCardProps) { const [schema, setSchema] = useState(undefined); // TODO: Type as joi type const [materialSymbolName, setMaterialSymbolName] = useState("error"); useEffect(() => { getSchemaByName(operatorInternalName).then(schema => { if(schema) { setSchema(schema.schema); setMaterialSymbolName(schema.materialSymbolName || "error"); } }); }, [operatorInternalName]); return (

{ schema?.describe().flags.label }

{ schema?.describe().flags.description }
); }