-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
633f5b1
commit 9d26ed5
Showing
8 changed files
with
81 additions
and
75 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
6 changes: 4 additions & 2 deletions
6
...atures/Domains/DomainRecordActionMenu.tsx → .../DomainRecords/DomainRecordActionMenu.tsx
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
File renamed without changes.
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
59 changes: 59 additions & 0 deletions
59
packages/manager/src/features/Domains/DomainDetail/DomainRecords/DomainRecordTable.tsx
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,59 @@ | ||
import React from 'react'; | ||
|
||
import { Table } from 'src/components/Table'; | ||
import { TableBody } from 'src/components/TableBody'; | ||
import { TableCell } from 'src/components/TableCell'; | ||
import { TableHead } from 'src/components/TableHead'; | ||
import { TableRow } from 'src/components/TableRow'; | ||
import { TableRowEmpty } from 'src/components/TableRowEmpty/TableRowEmpty'; | ||
|
||
import { StyledTableCell } from './DomainRecords.styles'; | ||
|
||
import type { IType } from './DomainRecords'; | ||
import type { DomainRecord } from '@linode/api-v4'; | ||
|
||
interface DomainRecordTableProps { | ||
paginatedData: DomainRecord[]; | ||
type: IType; | ||
} | ||
|
||
export const DomainRecordTable = (props: DomainRecordTableProps) => { | ||
const { paginatedData, type } = props; | ||
|
||
return ( | ||
<Table aria-label={`List of Domains ${type.title}`}> | ||
<TableHead> | ||
<TableRow> | ||
{type.columns.length > 0 && | ||
type.columns.map((col, columnIndex) => { | ||
return <TableCell key={columnIndex}>{col.title}</TableCell>; | ||
})} | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{type.data.length === 0 ? ( | ||
<TableRowEmpty colSpan={type.columns.length} /> | ||
) : ( | ||
paginatedData.map((data, idx) => { | ||
return ( | ||
<TableRow data-qa-record-row={type.title} key={idx}> | ||
{type.columns.length > 0 && | ||
type.columns.map(({ render, title }, columnIndex) => { | ||
return ( | ||
<StyledTableCell | ||
data-qa-column={title} | ||
key={columnIndex} | ||
parentColumn={title} | ||
> | ||
{render(data)} | ||
</StyledTableCell> | ||
); | ||
})} | ||
</TableRow> | ||
); | ||
}) | ||
)} | ||
</TableBody> | ||
</Table> | ||
); | ||
}; |
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
File renamed without changes.