import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo,useMemo}from"react";import styled from"styled-components";import{strikethroughText}from"../../utils";import{SchemaSelection}from"../common/SchemaSelection";import{SelectionTitle}from"../common";function DiscriminatorDropdownComponent({activeOneOfIdx:e,parent:o,onChange:t}){const i=useMemo((()=>(o.oneOf||[]).map(((e,o)=>({label:e.schema.deprecated?`${strikethroughText(e.title)} (deprecated)`:e.title,value:o})))),[o.oneOf]);return void 0===o.oneOf?null:_jsxs(Wrapper,{children:[_jsx(SelectionTitle,{children:"Discriminator"}),_jsx(SchemaSelection,{options:i,pointer:o.operationPointer,onChange:t,schema:o,defaultOneOfIdx:e})]})}export const Discriminator=memo(DiscriminatorDropdownComponent);const Wrapper=styled.div`
  display: flex;
  flex-direction: column;
  align-items: flex-start;
`;
//# sourceMappingURL=Discriminator.js.map