41 lines
1.6 KiB
TypeScript
41 lines
1.6 KiB
TypeScript
import { Button, Input } from "@common/components";;
|
|
import OperatorsComponents from "./OperatorsComponents";
|
|
import type { VerifyDetailResponseDto } from "@/entities/statistics/model/general-verification-interface";
|
|
|
|
interface FormulaComponentsProps {
|
|
data?: VerifyDetailResponseDto | null;
|
|
index?: number;
|
|
onDelete?: () => void;
|
|
onOperatorChange?: (value: string) => void;
|
|
handleFomulaDialog?: (show: boolean, data?: VerifyDetailResponseDto | null, index?: number) => void;
|
|
}
|
|
|
|
const FormulaComponents = ({ data, index, onDelete, onOperatorChange, handleFomulaDialog }: FormulaComponentsProps) => {
|
|
const cmprOpert = data?.cmprOpert;
|
|
|
|
return (
|
|
<div className='flex items-center gap-x-4 mb-2 p-2 justify-around rounded has-[.formulaDeleteBtn:hover]:bg-gray-100'>
|
|
<Button
|
|
type="button"
|
|
size="icon"
|
|
className="size-[3rem] shrink-0 rounded-full formulaDeleteBtn"
|
|
color='red'
|
|
onClick={onDelete}
|
|
>
|
|
<i className="ri-subtract-fill text-[16px]"></i>
|
|
</Button>
|
|
<Input
|
|
className='h-[4rem] !cursor-pointer'
|
|
placeholder='클릭하여 수식을 등록해주세요.'
|
|
id='formulaInput'
|
|
value={data ? data.kornArtopnEqtnCn : ''}
|
|
title={data ? data.kornArtopnEqtnCn : ''}
|
|
onClick={() => handleFomulaDialog?.(true, data, index)}
|
|
readOnly
|
|
/>
|
|
<OperatorsComponents cmprOpert={cmprOpert} onValueChange={onOperatorChange} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default FormulaComponents; |