import type { VerifyDetailResponseDto } from "@/entities/statistics/model/general-verification-interface"; import { Button, Input } from "@common/components"; import OperatorsComponents from "./OperatorsComponents"; type ClauseZone = "" | "zone-condition" | "zone-result"; interface FormulaComponentsProps { data?: VerifyDetailResponseDto | null; index?: number; zone?: ClauseZone; groupBy?: boolean; onGroupByChange?: (checked: boolean) => void; onDelete?: () => void; onOperatorChange?: (value: string) => void; handleFomulaDialog?: ( show: boolean, data?: VerifyDetailResponseDto | null, index?: number, ) => void; vrfcClsfCd?: string; } const zoneClassName: Record = { "": "bg-[#f9fafb]", "zone-condition": "bg-[#eef4ff]", "zone-result": "bg-[#fff4ea]", }; /** 저장용 백틱 래핑은 숨기고 사용자에게만 표시 */ const stripBacktickWrap = (value: string) => { if (value.length >= 2 && value.startsWith("`") && value.endsWith("`")) { return value.slice(1, -1); } return value; }; const FormulaComponents = ({ data, index, zone = "", groupBy = false, onGroupByChange, onDelete, onOperatorChange, handleFomulaDialog, vrfcClsfCd, }: FormulaComponentsProps) => { const cmprOpert = data?.cmprOpert; const displayFormula = data ? stripBacktickWrap(data.kornArtopnEqtnCn ?? "") : ""; return (
handleFomulaDialog?.(true, data, index)} readOnly />
{vrfcClsfCd !== "TOTAL" && }
); }; export default FormulaComponents;