refactor(companies-table): Simplify table and correct cell component

The 'City' and 'Postal Code' columns have been removed from the companies table to simplify the UI and reduce visual clutter. This change is reflected in both the table's JSX structure and the `useCompanyListPresenter` hook that defines the table headers.

Additionally, the `TableHead` component was incorrectly used for data cells within the table body. This has been fixed by replacing it with the semantically correct `TableCell` component.
This commit is contained in:
AmirReza Jamali
2025-09-24 11:56:46 +03:30
parent 3801073fd7
commit 339fb770fa
2 changed files with 19 additions and 26 deletions
+18 -24
View File
@@ -58,39 +58,33 @@ const CompaniesTable = ({}: IProps) => {
key={company.id} key={company.id}
className="odd:bg-gray-2 dark:odd:bg-gray-7" className="odd:bg-gray-2 dark:odd:bg-gray-7"
> >
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{index + 1} {index + 1}
</TableHead> </TableCell>
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{company.name} {company.name}
</TableHead> </TableCell>
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{company.email} {company.email}
</TableHead> </TableCell>
<TableHead className="w-full text-start" colSpan={100}> <TableCell className="w-full text-start" colSpan={100}>
{formatPhoneNumber(company.phone)} {formatPhoneNumber(company.phone)}
</TableHead> </TableCell>
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{company.address.country} {company.address.country}
</TableHead> </TableCell>
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{company.address.state} {company.address.state}
</TableHead> </TableCell>
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{company.address.city}
</TableHead>
<TableHead className="text-start" colSpan={100}>
{company.address.postal_code}
</TableHead>
<TableHead className="text-start" colSpan={100}>
{company.language} {company.language}
</TableHead> </TableCell>
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{company.currency} {company.currency}
</TableHead> </TableCell>
<TableHead className="text-start" colSpan={100}> <TableCell className="text-start" colSpan={100}>
{company.employee_count} {company.employee_count}
</TableHead> </TableCell>
<TableCell className="text-start xl:pr-7.5"> <TableCell className="text-start xl:pr-7.5">
<div className="flex items-center justify-start gap-x-3.5"> <div className="flex items-center justify-start gap-x-3.5">
<button <button
@@ -31,8 +31,7 @@ export const useCompanyListPresenter = () => {
"phone", "phone",
"country", "country",
"state", "state",
"city",
"postal code",
"language", "language",
"currency", "currency",
"employee count", "employee count",