Files
explore/ui/marketplace/EmptySearchResult.tsx
tom goriunovandGitHub 4335faeb35 UI/UX: Implement unified EmptyState component for stats page (#3195)
* add EmptyState component to toolkit and use it in the stats page

* remove EmptySearchResult component

* tweaks

* refactor ComingSoon component

* fix toolkit build

* rollback changes in main preset
2025-12-23 11:34:33 +01:00

43 lines
1.3 KiB
TypeScript

import React from 'react';
import { MarketplaceCategory } from 'types/client/marketplace';
import config from 'configs/app';
import { EmptyState } from 'toolkit/chakra/empty-state';
import { Link } from 'toolkit/chakra/link';
import { apos, space } from 'toolkit/utils/htmlEntities';
import IconSvg from 'ui/shared/IconSvg';
const feature = config.features.marketplace;
type Props = {
favoriteApps: Array<string>;
selectedCategoryId?: string;
};
const EmptySearchResult = ({ favoriteApps, selectedCategoryId }: Props) => (
<EmptyState
description={
(selectedCategoryId === MarketplaceCategory.FAVORITES && !favoriteApps.length) ? (
<>
You don{ apos }t have any favorite apps.<br/>
Click on the <IconSvg name="heart_outline" boxSize={ 5 } verticalAlign="text-bottom" color="icon.secondary"/>{ space }
icon on the app{ apos }s card to add it to Favorites.
</>
) : (
<>
No matching apps found.
{ 'suggestIdeasFormUrl' in feature && (
<>
{ ' ' }Have a groundbreaking idea or app suggestion?<br/>
<Link external href={ feature.suggestIdeasFormUrl }>Share it with us</Link>
</>
) }
</>
)
}
/>
);
export default React.memo(EmptySearchResult);