@useloops/design-system
Version:
The official React based Loops design system
2 lines (1 loc) • 995 B
JavaScript
import{useTheme as e}from"@mui/material";var t;!function(e){e.veryPositive="veryPositive",e.positive="positive",e.neutral="neutral",e.negative="negative",e.veryNegative="veryNegative"}(t||(t={}));const a=()=>{const a=e(),i=[{value:1,name:"Very positive",key:t.veryPositive,min:.6,max:1,color:a.custom.palette.data.sentimentVeryPositive},{value:.5,name:"Positive",key:t.positive,min:.2,max:.6,color:a.custom.palette.data.sentimentPositive},{value:0,name:"Neutral",key:t.neutral,min:-.19999,max:.2,color:a.custom.palette.data.sentimentNeutral},{value:-.5,name:"Negative",key:t.negative,min:-.59999,max:-.19999,color:a.custom.palette.data.sentimentNegative},{value:-1,name:"Very negative",key:t.veryNegative,min:-1,max:-.59999,color:a.custom.palette.data.sentimentVeryNegative}];return{sentimentCategories:i,getSentimentByScore:function(e){return i.find(t=>e>=t.min&&e<=t.max)||{name:"Unknown",color:"transparent",key:t.neutral,value:0,min:-1,max:1}}}};export{t as SenitmentKeyEnums,a as default};