MCPcopy Create free account
hub / github.com/bytebase/bytebase / ConditionRow

Function ConditionRow

frontend/src/react/components/ExprEditor.tsx:1224–1270  ·  view source on GitHub ↗
({
  expr,
  groupPath,
  operandIndex,
}: {
  expr: ConditionExpr;
  groupPath: Path;
  operandIndex: number;
})

Source from the content-addressed store, hash-verified

1222// ============================================================
1223
1224function ConditionRow({
1225 expr,
1226 groupPath,
1227 operandIndex,
1228}: {
1229 expr: ConditionExpr;
1230 groupPath: Path;
1231 operandIndex: number;
1232}) {
1233 const { readonly } = useExprEditorCtx();
1234 const doUpdate = useImmutableUpdate(groupPath);
1235
1236 return (
1237 <div className="w-full flex items-center gap-x-1">
1238 <FactorSelect
1239 expr={expr}
1240 groupPath={groupPath}
1241 operandIndex={operandIndex}
1242 />
1243 <OperatorSelect
1244 expr={expr}
1245 groupPath={groupPath}
1246 operandIndex={operandIndex}
1247 />
1248 <div className="flex-1 min-w-0">
1249 <ValueInput
1250 expr={expr}
1251 groupPath={groupPath}
1252 operandIndex={operandIndex}
1253 />
1254 </div>
1255 {!readonly && (
1256 <button
1257 type="button"
1258 className="shrink-0 size-7 flex items-center justify-center rounded-xs text-control-placeholder hover:text-control hover:bg-control-bg"
1259 onClick={() =>
1260 doUpdate((group) => {
1261 group.args.splice(operandIndex, 1);
1262 })
1263 }
1264 >
1265 <Trash2 className="size-3.5" />
1266 </button>
1267 )}
1268 </div>
1269 );
1270}
1271
1272// ============================================================
1273// RawStringEditor

Callers

nothing calls this directly

Calls 3

useExprEditorCtxFunction · 0.85
useImmutableUpdateFunction · 0.85
doUpdateFunction · 0.85

Tested by

no test coverage detected