import { PreviewComponentProps } from "../internal" ; import { NumberProperty , StringProperty } from "../../models" ; import { ArrayEnumPreview } from "./ArrayEnumPreview" ; category export function ArrayPropertyEnumPreview ( { name , value , property , size } ) { if ( property . dataType !== "array" ) throw Error ( "Picked wrong preview component ArrayEnumPreview" ) ; const ofProperty = property . of as StringProperty | NumberProperty ; if ( ! ofProperty . config ?. enumValues ) throw Error ( "Picked wrong preview component ArrayEnumPreview" ) ; if ( ! value ) return null ; const enumValues = ofProperty . config ?. enumValues ; return < ArrayEnumPreview name = { name } value = { value } enumValues = { enumValues } size = { size } / > ; }