feat(search-button): add empty check
This commit is contained in:
parent
1fcd64ad42
commit
40f551c426
|
@ -51,7 +51,7 @@ const SearchImages = ({
|
|||
|
||||
const data = await res.json();
|
||||
|
||||
const images = data.images;
|
||||
const images = data.images ?? [];
|
||||
setImages(images);
|
||||
setSlides(
|
||||
images.map((image: Image) => {
|
||||
|
|
|
@ -64,7 +64,7 @@ const Searchvideos = ({
|
|||
|
||||
const data = await res.json();
|
||||
|
||||
const videos = data.videos;
|
||||
const videos = data.videos ?? [];
|
||||
setVideos(videos);
|
||||
setSlides(
|
||||
videos.map((video: Video) => {
|
||||
|
|
Loading…
Reference in New Issue