Skip to content

Commit 59f49bc

Browse files
committed
refactor(CTable): update interface
1 parent abc5b4d commit 59f49bc

File tree

1 file changed

+6
-3
lines changed
  • packages/coreui-react/src/components/table

1 file changed

+6
-3
lines changed

packages/coreui-react/src/components/table/CTable.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export interface CTableProps extends Omit<TableHTMLAttributes<HTMLTableElement>,
7575
*
7676
* @since 4.3.0
7777
*/
78-
footer?: FooterItem[]
78+
footer?: (FooterItem | string)[]
7979
/**
8080
* Enable a hover state on table rows within a `<CTableBody>`.
8181
*/
@@ -253,8 +253,11 @@ export const CTable = forwardRef<HTMLTableElement, CTableProps>(
253253
{footer && (
254254
<CTableFoot {...tableFootProps}>
255255
<CTableRow>
256-
{footer.map((item: FooterItem, index: number) => (
257-
<CTableDataCell {...(item._props && { ...item._props })} key={index}>
256+
{footer.map((item: FooterItem | string, index: number) => (
257+
<CTableDataCell
258+
{...(typeof item === 'object' && item._props && { ...item._props })}
259+
key={index}
260+
>
258261
{typeof item === 'object' ? item.label : item}
259262
</CTableDataCell>
260263
))}

0 commit comments

Comments
 (0)