-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Magomed-Elbi Dzhukalaev <magomed-elbi_dzhukalaev@epam.com> Co-authored-by: Alexander <98586297+Alexander-Kezik@users.noreply.github.com>
- Loading branch information
1 parent
9145ec3
commit 904193e
Showing
17 changed files
with
655 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useTranslation } from 'next-i18next'; | ||
|
||
import { DialAIEntityModel } from '@/src/types/models'; | ||
import { PublishActions } from '@/src/types/publication'; | ||
import { Translation } from '@/src/types/translation'; | ||
|
||
import { ApplicationCard } from '@/src/components/Marketplace/ApplicationCard'; | ||
|
||
interface CardsListProps { | ||
entities: DialAIEntityModel[]; | ||
onCardClick: (entity: DialAIEntityModel) => void; | ||
onPublish?: (entity: DialAIEntityModel, action: PublishActions) => void; | ||
onDelete?: (entity: DialAIEntityModel) => void; | ||
onEdit?: (entity: DialAIEntityModel) => void; | ||
onRemove?: (entity: DialAIEntityModel) => void; | ||
isMobile?: boolean; | ||
title?: string; | ||
className?: string; | ||
} | ||
|
||
export const CardsList = ({ | ||
entities, | ||
onCardClick, | ||
onPublish, | ||
onDelete, | ||
onEdit, | ||
onRemove, | ||
isMobile, | ||
title, | ||
className, | ||
}: CardsListProps) => { | ||
const { t } = useTranslation(Translation.Marketplace); | ||
|
||
return ( | ||
<section className={className}> | ||
{!!title && <h2 className="text-xl font-semibold">{t(title)}</h2>} | ||
|
||
<div className="mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 lg:gap-6 2xl:grid-cols-4"> | ||
{entities.map((entity) => ( | ||
<ApplicationCard | ||
key={entity.id} | ||
entity={entity} | ||
onClick={onCardClick} | ||
onPublish={onPublish} | ||
onDelete={onDelete} | ||
onEdit={onEdit} | ||
onRemove={onRemove} | ||
isMobile={isMobile} | ||
/> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
}; |
Oops, something went wrong.