import CodeSnippet from 'components/interfaces/Docs/CodeSnippet' import Description from 'components/interfaces/Docs/Description' import Param from 'components/interfaces/Docs/Param' import Snippets from 'components/interfaces/Docs/Snippets' /** * TODO: need to support rpc with the same name and different params type */ const RpcContent = ({ autoApiService, rpcId, rpcs, paths, selectedLang, refreshDocs, showApiKey, }: any) => { const meta = rpcs[rpcId] const pathKey = `/rpc/${rpcId}` const path = paths && pathKey in paths ? paths[pathKey] : undefined const keyToShow = !!showApiKey ? showApiKey : 'SUPABASE_KEY' if (!path) return null const { post: { parameters, summary }, } = path const rpcParamsObject = parameters && parameters[0] && parameters[0].schema && parameters[0].schema.properties ? parameters[0].schema.properties : {} const rpcParams = Object.entries(rpcParamsObject) .map(([k, v]: any) => ({ name: k, ...v })) .filter((x) => !!x.name) return ( <>