* fix: Unauthorized request to views.list from shared documents * Bump dep styled-components * chore: Normalize 'new' actions in settings area to top right chore: Add translation hooks to API tokens screen chore: Move API tokens loading to paginated list
31 lines
616 B
JavaScript
31 lines
616 B
JavaScript
// @flow
|
||
import * as React from "react";
|
||
import ApiKey from "models/ApiKey";
|
||
import Button from "components/Button";
|
||
import ListItem from "components/List/Item";
|
||
|
||
type Props = {|
|
||
token: ApiKey,
|
||
onDelete: (tokenId: string) => Promise<void>,
|
||
|};
|
||
|
||
const TokenListItem = ({ token, onDelete }: Props) => {
|
||
return (
|
||
<ListItem
|
||
key={token.id}
|
||
title={
|
||
<>
|
||
{token.name} – <code>{token.secret}</code>
|
||
</>
|
||
}
|
||
actions={
|
||
<Button onClick={() => onDelete(token.id)} neutral>
|
||
Revoke
|
||
</Button>
|
||
}
|
||
/>
|
||
);
|
||
};
|
||
|
||
export default TokenListItem;
|