import{j as a,s as o,d as n}from"./index-DET0E_3l.js";const x=({name:s,relatedChip:i,titleClassName:u,parentItems:r,centerControls:p,controls:b,isLoaded:m,formik:e,renameDisabledReason:c})=>{const l=c===void 0,d=()=>{setTimeout(()=>window.dispatchEvent(new Event("resize")),10),!(!l||!e)&&e.setValues({...e.values,name:s,isRenaming:!e.values.isRenaming})};return a.jsxs("div",{className:"p-panel__header rename-header",children:[a.jsx("h1",{className:"u-off-screen",children:s}),a.jsxs("div",{className:o("p-panel__title",u),children:[a.jsxs("nav",{className:"p-breadcrumbs p-breadcrumbs--large","aria-label":"Breadcrumbs",children:[a.jsxs("ol",{className:"p-breadcrumbs__items breadcrumb-wrapper",children:[r.map((t,h)=>a.jsx("li",{className:"p-heading--4 u-no-margin--bottom continuous-breadcrumb",children:t},h)),e!=null&&e.values.isRenaming?a.jsxs("li",{className:"p-breadcrumbs__item rename",children:[a.jsx(n.Input,{autoFocus:!0,id:"name",name:"name",className:"name-input",onBlur:e.handleBlur,onChange:e.handleChange,value:e.values.name,error:e.touched.name?e.errors.name:null,onKeyUp:t=>t.key==="Enter"&&void e.submitForm(),type:"text"}),a.jsxs("div",{children:[a.jsx(n.Button,{appearance:"base",className:"cancel",onClick:d,children:"Cancel"}),a.jsx(n.ActionButton,{appearance:"positive",loading:e.isSubmitting,disabled:!e.isValid||e.isSubmitting||s===e.values.name,onClick:()=>void e.submitForm(),children:"Save"})]})]}):a.jsx("li",{className:"p-heading--4 u-no-margin--bottom name continuous-breadcrumb u-truncate",onClick:d,title:l?`Rename ${s}`:"",children:a.jsx(n.Tooltip,{message:!l&&c,position:"btm-left",children:s})})]}),i]},"breadcrumbs"),!(e!=null&&e.values.isRenaming)&&p]}),m&&!(e!=null&&e.values.isRenaming)&&a.jsx("div",{className:"p-panel__controls",children:b})]})};export{x as R};
