mirror of
https://github.com/hexastack/hexabot
synced 2025-02-01 23:23:51 +00:00
Merge pull request #441 from Hexastack/440-issue-missing-dynamic-maxinput-prop-in-quick-replies-input-component
Some checks failed
Build and Push Docker API Image / build-and-push (push) Has been cancelled
Build and Push Docker Base Image / build-and-push (push) Has been cancelled
Build and Push Docker NLU Image / build-and-push (push) Has been cancelled
Build and Push Docker UI Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker API Image / build-and-push (push) Has been cancelled
Build and Push Docker Base Image / build-and-push (push) Has been cancelled
Build and Push Docker NLU Image / build-and-push (push) Has been cancelled
Build and Push Docker UI Image / build-and-push (push) Has been cancelled
fix: update quick replies maxInput value
This commit is contained in:
commit
b8d8bfeaa6
@ -21,12 +21,14 @@ type QuickRepliesInput = {
|
||||
value: StdQuickReply[];
|
||||
onChange: (patterns: StdQuickReply[]) => void;
|
||||
minInput?: number;
|
||||
maxInput?: number;
|
||||
};
|
||||
|
||||
const QuickRepliesInput: FC<QuickRepliesInput> = ({
|
||||
value,
|
||||
onChange,
|
||||
minInput = 1,
|
||||
maxInput = 11,
|
||||
}) => {
|
||||
const { t } = useTranslate();
|
||||
const [quickReplies, setQuickReplies] = useState<
|
||||
@ -122,7 +124,7 @@ const QuickRepliesInput: FC<QuickRepliesInput> = ({
|
||||
variant="contained"
|
||||
startIcon={<AddIcon />}
|
||||
onClick={addInput}
|
||||
disabled={quickReplies.length > 10}
|
||||
disabled={quickReplies.length >= maxInput}
|
||||
>
|
||||
{t("button.add_quick_reply")}
|
||||
</Button>
|
||||
|
Loading…
Reference in New Issue
Block a user