mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
45 lines
941 B
TypeScript
45 lines
941 B
TypeScript
import {
|
|
Table,
|
|
Thead,
|
|
Tbody,
|
|
Tr,
|
|
Th,
|
|
} from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import type { ApiKeys, ApiKey } from 'types/api/account';
|
|
|
|
import ApiKeyTableItem from './ApiKeyTableItem';
|
|
|
|
interface Props {
|
|
data: ApiKeys;
|
|
onEditClick: (item: ApiKey) => void;
|
|
onDeleteClick: (item: ApiKey) => void;
|
|
limit: number;
|
|
}
|
|
|
|
const ApiKeyTable = ({ data, onDeleteClick, onEditClick, limit }: Props) => {
|
|
return (
|
|
<Table variant="simple" minWidth="600px">
|
|
<Thead>
|
|
<Tr>
|
|
<Th>{ `API key token (limit ${ limit } keys)` }</Th>
|
|
<Th width="108px"></Th>
|
|
</Tr>
|
|
</Thead>
|
|
<Tbody>
|
|
{ data.map((item) => (
|
|
<ApiKeyTableItem
|
|
item={ item }
|
|
key={ item.api_key }
|
|
onDeleteClick={ onDeleteClick }
|
|
onEditClick={ onEditClick }
|
|
/>
|
|
)) }
|
|
</Tbody>
|
|
</Table>
|
|
);
|
|
};
|
|
|
|
export default ApiKeyTable;
|