add research button and translate

This commit is contained in:
smanylov
2026-02-23 13:41:07 +07:00
parent 82e27a0ce4
commit 1b9b843f1a
5 changed files with 145 additions and 78 deletions
+48 -33
View File
@@ -34,38 +34,46 @@ export async function searchGlobalFiles(fileId: string, currentPage: number) {
console.log(currentPage);
//удалить когда поиск будет нормально работать
/* return {
images: [
{
url: 'string1',
pageTitle: `string1 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
},
{
url: 'string1',
pageTitle: `string2 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
},
{
url: 'string1',
pageTitle: `string3 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
}
],
page: 0,
pageSize: 0,
totalPages: 11,
totalResults: 100,
} */
/* return {
images: [
{
url: 'string1',
pageTitle: `string1 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
},
{
url: 'string1',
pageTitle: `string2 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
},
{
url: 'string1',
pageTitle: `string3 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
}
],
page: 0,
pageSize: 0,
totalPages: 11,
totalResults: 100,
} */
/* return {
images: [],
page: 0,
pageSize: 0,
totalPages: 0,
totalResults: 0
} */
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
@@ -97,7 +105,14 @@ export async function searchGlobalFiles(fileId: string, currentPage: number) {
}
} catch (error) {
return error
return {
images: [],
page: 0,
pageSize: 0,
totalPages: 0,
totalResults: 0,
error: 'error'
}
}
}