MCPcopy
hub / github.com/deepops-ai/deepops / onChangeUnitType

Function onChangeUnitType

ui/src/components/Unit.tsx:63–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62
63 const onChangeUnitType = t => {
64 switch (t) {
65 case "none":
66 setUnits({
67 unitsType: t,
68 units: []
69 })
70 break;
71 case "short":
72 setUnits({
73 unitsType: t,
74 units: [
75 {
76 operator: "/",
77 rhs: 1,
78 unit: ""
79 },
80 {
81 operator: "/",
82 rhs: 1000,
83 unit: "k"
84 },
85 {
86 operator: "/",
87 rhs: 1000000,
88 unit: "m"
89 },
90 ]
91 })
92 break;
93 case "percent":
94 setUnits({
95 unitsType: t,
96 units: [{
97 operator: "x",
98 rhs: 100,
99 unit: "%"
100 }]
101 })
102 break
103 case "percent%":
104 setUnits({
105 unitsType: t,
106 units: [{
107 operator: "x",
108 rhs: 1,
109 unit: "%"
110 }]
111 })
112 break
113 case "time":
114 setUnits({
115 unitsType: t,
116 units: [
117 {
118 operator: "/",
119 rhs: 1,
120 unit: "ms"

Callers 1

UnitPickerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected