import e from"prop-types";import t from"../editModals/DvdCommentEdit/DvdCommentEdit.js";import o from"../editModals/PCCommentEdit/PCCommentEdit.js";import n from"../editModals/NptLessonsCommentEdit/NptLessonsCommentEdit.js";import s from"../editModals/LessonsLearnedEdit/LessonsLearnedEdit.js";import{FEED_ITEM_TYPES as i}from"../../../constants/feed.js";import d from"../../../utils/main.js";import a from"../../PostPreviewDialog/index.js";import m from"../../TracesEditModal/TracesEditModalContainer.js";import r from"../editModals/HookloadCommentEdit/HookloadCommentEdit.js";import{jsx as l}from"react/jsx-runtime";var c=function(e){var c,p,u,v,f,C,S,y,E,x,M,I=e.feedItem,h=e.onClose,D=e.onSave,j=e.tracesMinDateSec,T=e.tracesMaxDateSec,_=e.tracesAssetId;return"dvd_comment"===I.type?l(t,{feedItem:I,onClose:h,onSave:D}):"hookload_broomstick_comment"===I.type?l(r,{feedItem:I,onClose:h,onSave:D}):"pc_comment"===I.type?l(o,{feedItem:I,onClose:h,onSave:D}):"npt_lessons_comment"===I.type?l(n,{feedItem:I,onClose:h,onSave:D}):"lessons_learned"===I.type?l(s,{feedItem:I,onClose:h,onSave:D}):I.type===i.POST?l(a,{open:!0,title:"Edit",fileUrl:null===(c=I.context)||void 0===c||null===(p=c.post)||void 0===p||null===(u=p.attachment)||void 0===u?void 0:u.url,fileName:(null===(v=I.context)||void 0===v||null===(f=v.post)||void 0===f||null===(C=f.attachment)||void 0===C?void 0:C.url)&&d.getFileNameWithExtensionFromPath(null===(S=I.context)||void 0===S||null===(y=S.post)||void 0===y||null===(E=y.attachment)||void 0===E?void 0:E.url),handleClose:h,handleShare:function(e,t,o,n){return D({context:{post:{body:e,attachment:{test:1,file_name:n,url:t,size:o}}}})},message:null===(x=I.context)||void 0===x||null===(M=x.post)||void 0===M?void 0:M.body,okButtonText:"Save",cancelButtonText:"Discard changes",companyId:I.company_id}):I.type===i.TRACES_MEMO?j&&T&&_&&l(m,{feedItem:I,onSave:D,onClose:h,minDateSec:j,maxDateSec:T,assetId:_}):null};c.propTypes={feedItem:e.shape().isRequired,onClose:e.func.isRequired,onSave:e.func.isRequired,tracesMinDateSec:e.oneOfType([e.string,e.number]),tracesMaxDateSec:e.oneOfType([e.string,e.number]),tracesAssetId:e.oneOfType([e.string,e.number])},c.defaultProps={tracesMinDateSec:void 0,tracesMaxDateSec:void 0,tracesAssetId:void 0};export{c as default};
//# sourceMappingURL=FeedItemEditModal.js.map
