diff options
Diffstat (limited to 'src/app/kdrama/components')
| -rw-r--r-- | src/app/kdrama/components/popular.jsx | 2 | ||||
| -rw-r--r-- | src/app/kdrama/components/recent.jsx | 2 | ||||
| -rw-r--r-- | src/app/kdrama/components/search.jsx | 15 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/app/kdrama/components/popular.jsx b/src/app/kdrama/components/popular.jsx index d9126ec..4b8b293 100644 --- a/src/app/kdrama/components/popular.jsx +++ b/src/app/kdrama/components/popular.jsx @@ -19,7 +19,7 @@ export default async function PopularDramas() { > <div className={styles.AnimeEntry}> <Image - src={item.image} + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`} width={160} height={240} alt="Drama Poster" diff --git a/src/app/kdrama/components/recent.jsx b/src/app/kdrama/components/recent.jsx index 759e179..0b6b7f6 100644 --- a/src/app/kdrama/components/recent.jsx +++ b/src/app/kdrama/components/recent.jsx @@ -19,7 +19,7 @@ export default async function RecentDramas() { > <div className={styles.AnimeEntry}> <Image - src={item.image} + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`} width={160} height={240} alt="Drama Poster" diff --git a/src/app/kdrama/components/search.jsx b/src/app/kdrama/components/search.jsx index 4c9d00c..f9ba174 100644 --- a/src/app/kdrama/components/search.jsx +++ b/src/app/kdrama/components/search.jsx @@ -10,11 +10,14 @@ import Link from "next/link"; export default function DramaSearch() { const [title, setTitle] = useState(""); const [infoTitle, setInfoTitle] = useState(null); + const [loadingText, setLoadingText] = useState(null); - async function getSearchResults(title) { + const handleSearch = async (title) => { + setLoadingText(true); const data = await FetchSearchTitle(title); + setLoadingText(false); setInfoTitle(data); - } + }; return ( <div className={styles.SearchContainer}> @@ -25,12 +28,16 @@ export default function DramaSearch() { onChange={(event) => setTitle(event.target.value)} onKeyDown={async (e) => { if ((e.key === "Enter" || e.code === 13) && title) { - await getSearchResults(e.target.value); + await handleSearch(e.target.value); } }} ></input> </div> + {loadingText && ( + <p className={styles.LoadingText}>Wait a moment...</p> + )} + <div className={styles.SearchResults}> {infoTitle && infoTitle.results.map((item, index) => ( @@ -42,7 +49,7 @@ export default function DramaSearch() { <div className={styles.SearchEntry}> <p>{item.title}</p> <Image - src={item.image} + src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`} width={110} height={180} alt="Drama Poster" |