feat: add missing propTypes

This commit is contained in:
kasia.oczkowska
2024-06-05 13:26:56 +01:00
parent 725b38c697
commit 3f5df118a0
53 changed files with 597 additions and 81 deletions

View File

@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import * as React from 'react';
import throttle from 'lodash/throttle';
import isEmpty from 'lodash/isEmpty';
@@ -6,9 +7,11 @@ import JSONViewer from 'components/JSONViewer';
import SearchInput from 'components/SearchInput';
import useFormatMessage from 'hooks/useFormatMessage';
import filterObject from 'helpers/filterObject';
const SearchableJSONViewer = ({ data }) => {
const [filteredData, setFilteredData] = React.useState(data);
const formatMessage = useFormatMessage();
const onSearchChange = React.useMemo(
() =>
throttle((event) => {
@@ -26,6 +29,7 @@ const SearchableJSONViewer = ({ data }) => {
}, 400),
[data],
);
return (
<>
<Box my={2}>
@@ -38,4 +42,9 @@ const SearchableJSONViewer = ({ data }) => {
</>
);
};
SearchableJSONViewer.propTypes = {
data: PropTypes.object.isRequired,
};
export default SearchableJSONViewer;