|
@@ -1,18 +1,24 @@
|
|
|
import React, { useState, useEffect } from 'react';
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
|
|
|
|
import { useTranslation } from 'next-i18next';
|
|
import { useTranslation } from 'next-i18next';
|
|
|
-import PropTypes from 'prop-types';
|
|
|
|
|
import {
|
|
import {
|
|
|
Modal, ModalHeader, ModalBody, ModalFooter,
|
|
Modal, ModalHeader, ModalBody, ModalFooter,
|
|
|
} from 'reactstrap';
|
|
} from 'reactstrap';
|
|
|
|
|
|
|
|
import TagsInput from './TagsInput';
|
|
import TagsInput from './TagsInput';
|
|
|
|
|
|
|
|
-function TagEditModal(props) {
|
|
|
|
|
- const [tags, setTags] = useState([]);
|
|
|
|
|
|
|
+type Props = {
|
|
|
|
|
+ tags: string[],
|
|
|
|
|
+ isOpen: boolean,
|
|
|
|
|
+ onClose?: () => void,
|
|
|
|
|
+ onTagsUpdated?: (tags: string[]) => Promise<void> | void,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+function TagEditModal(props: Props): JSX.Element {
|
|
|
|
|
+ const [tags, setTags] = useState<string[]>([]);
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
- function onTagsUpdatedByTagsInput(tags) {
|
|
|
|
|
|
|
+ function onTagsUpdatedByTagsInput(tags: string[]) {
|
|
|
setTags(tags);
|
|
setTags(tags);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -54,11 +60,4 @@ function TagEditModal(props) {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-TagEditModal.propTypes = {
|
|
|
|
|
- tags: PropTypes.array,
|
|
|
|
|
- isOpen: PropTypes.bool.isRequired,
|
|
|
|
|
- onClose: PropTypes.func,
|
|
|
|
|
- onTagsUpdated: PropTypes.func,
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
export default TagEditModal;
|
|
export default TagEditModal;
|