diff --git a/components/index.js b/components/index.js index b00c2a0..3264a34 100644 --- a/components/index.js +++ b/components/index.js @@ -8,4 +8,5 @@ export {default as CopyShapeSource} from "./core/CopyShapeSource"; // utils export { default as Header } from "./utils/Header"; export { default as ShapeList } from './utils/ShapeList'; -export { default as Radios } from './utils/Radios'; \ No newline at end of file +export { default as Radios } from './utils/Radios'; +export { default as NoShapeFound } from './utils/NoShapeFound'; \ No newline at end of file diff --git a/components/utils/Header.js b/components/utils/Header.js index 1b0ece8..1579101 100644 --- a/components/utils/Header.js +++ b/components/utils/Header.js @@ -170,7 +170,7 @@ const Header = ({ value={searchTerm} onChange={(e) => setSearchTerm(e.target.value)} /> - setSearchTerm('')}/> + {searchTerm && setSearchTerm('')}/>} { + + return( +

No Shape Found!

+ ) +}; + +export default NoShapeFound; \ No newline at end of file diff --git a/components/utils/ShapeList.js b/components/utils/ShapeList.js index 0d74813..554f15b 100644 --- a/components/utils/ShapeList.js +++ b/components/utils/ShapeList.js @@ -28,7 +28,7 @@ import { BiExport } from "react-icons/bi"; import { BsFillHeartFill, BsHeart} from "react-icons/bs"; // Export Shape -import { ExportShape, CopyShapeSource } from '..'; +import { ExportShape, CopyShapeSource, NoShapeFound } from '..'; // misc unitless import { getShapeFileName, getShapeId } from '../../utils/misc'; @@ -347,6 +347,8 @@ const ShapeList = ( } }; + + return ( @@ -362,7 +364,8 @@ const ShapeList = ( shape= { shapeToSourceCopy } /> } - {filteredShape.map((shape, index) => ( + { + filteredShape.length === 0 ? : filteredShape.map((shape, index) => (