export default function CollapsingEndpoint()

in src/CollapsingEndpoint.tsx [12:27]


export default function CollapsingEndpoint({ header, name }: Props) {
  const schema = useSchema();

  const renderEndpoint = useCallback(() => {
    for (const endpoint of schema.endpoints) {
      if (endpoint.name === name) {
        return <Endpoint endpoint={endpoint} />;
      }
    }
    return <Details value="No additional info" />
  }, [name, schema.endpoints]);

  return (
    <CollapsingDetails header={header} value=<code>{ name }</code> cb={renderEndpoint} />
  );
}