fix(app-store): show a text when there is no filtering result

This commit is contained in:
Nicolas Meienberger 2023-10-24 20:52:22 +02:00 committed by Nicolas Meienberger
parent 8ab15acf84
commit 9612ff3336
2 changed files with 12 additions and 9 deletions

View file

@ -1,6 +1,7 @@
'use client';
import React from 'react';
import { EmptyPage } from '../../../../components/EmptyPage';
import { AppStoreTile } from '../AppStoreTile';
import { AppTableData } from '../../helpers/table.types';
import { useAppStoreState } from '../../state/appStoreState';
@ -15,11 +16,17 @@ export const AppStoreTable: React.FC<IProps> = ({ data }) => {
const tableData = React.useMemo(() => sortTable({ data: data || [], col: sort, direction: sortDirection, category, search }), [data, sort, sortDirection, category, search]);
if (!tableData.length) {
return <EmptyPage title="apps.app-store.no-results" subtitle="apps.app-store.no-results-subtitle" />;
}
return (
<div className="row row-cards">
{tableData.map((app) => (
<AppStoreTile key={app.id} app={app} />
))}
<div className="card px-3 pb-3">
<div className="row row-cards">
{tableData.map((app) => (
<AppStoreTile key={app.id} app={app} />
))}
</div>
</div>
);
};

View file

@ -15,9 +15,5 @@ export async function generateMetadata(): Promise<Metadata> {
export default async function AppStorePage() {
const { apps } = await AppServiceClass.listApps();
return (
<div className="card px-3 pb-3">
<AppStoreTable data={apps} />
</div>
);
return <AppStoreTable data={apps} />;
}