-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Componentizes table cell types and adds permutations
- Loading branch information
Showing
12 changed files
with
685 additions
and
96 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,34 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import React from 'react'; | ||
|
||
import { TableTdElement, TableTdElementProps } from '../body-cell/td-element'; | ||
import { ItemsLoader, ItemsLoaderProps } from './items-loader'; | ||
|
||
export interface TableLoaderCellProps<ItemType> extends TableTdElementProps, ItemsLoaderProps<ItemType> {} | ||
|
||
export function TableLoaderCell<ItemType>({ | ||
item, | ||
loadingStatus, | ||
renderLoaderPending, | ||
renderLoaderLoading, | ||
renderLoaderError, | ||
trackBy, | ||
...props | ||
}: TableLoaderCellProps<ItemType>) { | ||
return ( | ||
<TableTdElement {...props}> | ||
{props.isRowHeader ? ( | ||
<ItemsLoader | ||
item={item} | ||
loadingStatus={loadingStatus} | ||
renderLoaderPending={renderLoaderPending} | ||
renderLoaderLoading={renderLoaderLoading} | ||
renderLoaderError={renderLoaderError} | ||
trackBy={trackBy} | ||
/> | ||
) : null} | ||
</TableTdElement> | ||
); | ||
} |
Oops, something went wrong.