diff --git a/locales/extracted/en.json b/locales/extracted/en.json index 25a7de42..7fb3fa5f 100644 --- a/locales/extracted/en.json +++ b/locales/extracted/en.json @@ -247,6 +247,7 @@ "organizations.organizationView.breadcrumbs.settings": "Settings", "organizations.organizationView.newOrganization.title": "New Organization", "organizations.organizationView.notFound": "Organization not found.", + "organizations.showing": "Showing {count} {number, plural, =0 {organizations} one {organization} other {organizations}}.", "organizations.subtitle": "View and manage Organizations.", "organizations.title": "Settings", "organizations.toast.create.success": "Organization created!", diff --git a/locales/extracted/pt.json b/locales/extracted/pt.json index bf5d193b..b510a1de 100644 --- a/locales/extracted/pt.json +++ b/locales/extracted/pt.json @@ -286,5 +286,6 @@ "ledgers.products.showing": "Mostrando {count} {number, plural, =0 {produtos} one {produto} other {produtos}}.", "ledgers.showing": "Mostrando {count} {number, plural, =0 {ledgers} one {ledger} other {ledgers}}.", "ledgers.accounts.showing": "Mostrando {count} {number, plural, =0 {contas} one {conta} other {contas}}.", - "ledgers.portfolios.showing": "Mostrando {count} {number, plural, =0 {portfólios} one {portfólio} other {portfólios}}." + "ledgers.portfolios.showing": "Mostrando {count} {number, plural, =0 {portfólios} one {portfólio} other {portfólios}}.", + "organizations.showing": "Mostrando {count} {number, plural, =0 {organizações} one {organização} other {organizações}}." } diff --git a/src/app/(routes)/settings/organizations-tab-content.tsx b/src/app/(routes)/settings/organizations-tab-content.tsx index b772575b..a2d94ab9 100644 --- a/src/app/(routes)/settings/organizations-tab-content.tsx +++ b/src/app/(routes)/settings/organizations-tab-content.tsx @@ -31,6 +31,7 @@ import { useConfirmDialog } from '@/components/confirmation-dialog/use-confirm-d import ConfirmationDialog from '@/components/confirmation-dialog' import { Badge } from '@/components/ui/badge' import { OrganizationEntity } from '@/core/domain/entities/organization-entity' +import { EntityDataTable } from '@/components/entity-data-table' export const OrganizationsTabContent = () => { const intl = useIntl() @@ -115,110 +116,127 @@ export const OrganizationsTabContent = () => { )} - - {data?.items && data.items.length > 0 && ( - - - - - - {intl.formatMessage({ - id: 'common.id', - defaultMessage: 'ID' - })} - - - {intl.formatMessage({ - id: `entity.organization.legalName`, - defaultMessage: 'Legal Name' - })} - - - {intl.formatMessage({ - id: `entity.organization.doingBusinessAs`, - defaultMessage: 'Trade Name' - })} - - - {intl.formatMessage({ - id: `entity.organization.legalDocument`, - defaultMessage: 'Document' - })} - - - {intl.formatMessage({ - id: `entity.organization.status`, - defaultMessage: 'Status' - })} - - - {intl.formatMessage({ - id: 'common.actions', - defaultMessage: 'Actions' - })} - - - - - {data.items.map((organization) => ( - - {organization.id} - {organization.legalName} - {organization.doingBusinessAs} - {organization.legalDocument} - - - {organization.status.code === 'ACTIVE' - ? intl.formatMessage({ - id: 'common.active', - defaultMessage: 'Active' - }) - : intl.formatMessage({ - id: 'common.inactive', - defaultMessage: 'Inactive' - })} - - - - - - - - - handleEdit(organization)} - > - {intl.formatMessage({ - id: `common.edit`, - defaultMessage: 'Edit' - })} - - - handleDialogOpen(organization.id!)} - > - {intl.formatMessage({ - id: `common.delete`, - defaultMessage: 'Delete' - })} - - - - + + {data?.items && data.items.length > 0 && ( + +
+ + + + {intl.formatMessage({ + id: 'common.id', + defaultMessage: 'ID' + })} + + + {intl.formatMessage({ + id: `entity.organization.legalName`, + defaultMessage: 'Legal Name' + })} + + + {intl.formatMessage({ + id: `entity.organization.doingBusinessAs`, + defaultMessage: 'Trade Name' + })} + + + {intl.formatMessage({ + id: `entity.organization.legalDocument`, + defaultMessage: 'Document' + })} + + + {intl.formatMessage({ + id: `entity.organization.status`, + defaultMessage: 'Status' + })} + + + {intl.formatMessage({ + id: 'common.actions', + defaultMessage: 'Actions' + })} + - ))} - -
-
- )} + + + {data.items.map((organization) => ( + + {organization.id} + {organization.legalName} + {organization.doingBusinessAs} + {organization.legalDocument} + + + {organization.status.code === 'ACTIVE' + ? intl.formatMessage({ + id: 'common.active', + defaultMessage: 'Active' + }) + : intl.formatMessage({ + id: 'common.inactive', + defaultMessage: 'Inactive' + })} + + + + + + + + + handleEdit(organization)} + > + {intl.formatMessage({ + id: `common.edit`, + defaultMessage: 'Edit' + })} + + + handleDialogOpen(organization.id!)} + > + {intl.formatMessage({ + id: `common.delete`, + defaultMessage: 'Delete' + })} + + + + + + ))} + + + + )} + + + + {intl.formatMessage( + { + id: 'organizations.showing', + defaultMessage: + 'Showing {count} {number, plural, =0 {organizations} one {organization} other {organizations}}.' + }, + { + number: data?.items?.length, + count: {data?.items?.length} + } + )} + + + ) }