import{number as a,string as e,shape as t}from"prop-types";import i from"moment";import{makeStyles as l,Typography as n}from"@material-ui/core";import{convertValue as r,getUnitDisplay as c}from"../../../../../utils/convert.js";import{purifyPlanName as m,getColorBySeverity as o}from"../../../../../utils/accuracy.js";import{jsxs as p,jsx as u}from"react/jsx-runtime";var s=l((function(a){return{wrapper:{display:"flex",flexDirection:"column",margin:"0 20px 10px 0",minWidth:"290px"},planValueWrapper:{display:"flex",alignItems:"baseline"},planUnit:{color:a.palette.grey[400],marginLeft:5},planText:{color:a.palette.grey[400]}}})),d=function(a){var e,t=a.timestamp,l=a.initialPlanName,d=a.cumulativeTvdChange,v=a.accuracyData,f=s(),h=t?i.unix(t).format("MM/DD/YY"):"",y=m(l);return d&&(y="".concat(y,", ").concat(d," ft cumulative TVD change")),p("div",{className:"c-survey-station-feed-item__accuracy-plan",children:[u(n,{variant:"subtitle1",children:"Minimum Distance to Plan:"}),p("div",{className:f.planValueWrapper,children:[u(n,{variant:"h5",style:{color:o(v)},children:parseFloat(null===(e=r(null==v?void 0:v.distance_to_plan,"length","ft"))||void 0===e?void 0:e.toFixed(1))}),p(n,{variant:"caption",className:f.planUnit,children:["(",c("length"),")"]})]}),u(n,{variant:"body1",className:f.planText,children:y||h})]})};d.propTypes={timestamp:a,initialPlanName:e,cumulativeTvdChange:e,accuracyData:t().isRequired},d.defaultProps={timestamp:null,initialPlanName:"",cumulativeTvdChange:""};export{d as default};
