Files
medusa-store/www/apps/api-reference/components/MDXComponents/Security/index.tsx
Shahed Nasser 4d632e7a5d docs: added tests for components in api-reference project (#14428)
* add tests (WIP)

* added test for h2

* finished adding tests

* fixes

* fixes

* fixes
2026-01-05 10:56:56 +02:00

36 lines
906 B
TypeScript

import React from "react"
import dynamic from "next/dynamic"
import type { OpenAPI } from "types"
import type { SecurityDescriptionProps } from "./Description"
import { Fragment } from "react"
const SecurityDescription = dynamic<SecurityDescriptionProps>(
async () => import("./Description")
) as React.FC<SecurityDescriptionProps>
type SecurityProps = {
specs?: OpenAPI.OpenAPIV3.Document
}
const Security = ({ specs }: SecurityProps) => {
return (
<div>
{specs && (
<>
{Object.values(specs.components?.securitySchemes || {}).map(
(securitySchema, index) => (
<Fragment key={index}>
{!("$ref" in securitySchema) && (
<SecurityDescription securitySchema={securitySchema} />
)}
</Fragment>
)
)}
</>
)}
</div>
)
}
export default Security