fix: update quick replies maxInput value

This commit is contained in:
yassinedorbozgithub 2024-12-10 15:16:49 +01:00
parent 8e5574f32d
commit 56ae8a9993

View File

@ -21,12 +21,14 @@ type QuickRepliesInput = {
value: StdQuickReply[]; value: StdQuickReply[];
onChange: (patterns: StdQuickReply[]) => void; onChange: (patterns: StdQuickReply[]) => void;
minInput?: number; minInput?: number;
maxInput?: number;
}; };
const QuickRepliesInput: FC<QuickRepliesInput> = ({ const QuickRepliesInput: FC<QuickRepliesInput> = ({
value, value,
onChange, onChange,
minInput = 1, minInput = 1,
maxInput = 11,
}) => { }) => {
const { t } = useTranslate(); const { t } = useTranslate();
const [quickReplies, setQuickReplies] = useState< const [quickReplies, setQuickReplies] = useState<
@ -109,7 +111,7 @@ const QuickRepliesInput: FC<QuickRepliesInput> = ({
onClick={addInput} onClick={addInput}
startIcon={<AddIcon />} startIcon={<AddIcon />}
sx={{ marginTop: 2, float: "right" }} sx={{ marginTop: 2, float: "right" }}
disabled={quickReplies.length > 10} disabled={quickReplies.length >= maxInput}
> >
{t("button.add")} {t("button.add")}
</Button> </Button>