import Translate from "@docusaurus/Translate"
import { CreateEdge } from "@theme/JSONSchemaViewer/components"
import { SchemaHierarchyComponent } from "@theme/JSONSchemaViewer/contexts"
import type { JSX } from "react"
import type { JSONSchemaNS } from "@theme/JSONSchemaViewer/types"
type Props = {
[x: string]: any
schema: JSONSchemaNS.Array
}
// Translated label
function AdditionalItemsLabel({ count }: { count: number }): JSX.Element {
return (
)
}
// To support that scenario not possible anymore in draft-2020-12
export default function CreateAdditionalItems(props: Props): JSX.Element {
const { schema } = props
let items = schema.additionalItems
// If undefined or boolean, print nothing
if (items === undefined || typeof items === "boolean") {
return <>>
}
// Because of "items", starting index isn't the same
const startingIndex = Array.isArray(schema.items) ? schema.items.length : 1
return (