Add delete API key (#25)
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
} from "@unsend/ui/src/table";
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import { api } from "~/trpc/react";
|
||||
import DeleteApiKey from "./delete-api-key";
|
||||
|
||||
export default function ApiList() {
|
||||
const apiKeysQuery = api.apiKey.getApiKeys.useQuery();
|
||||
@@ -24,7 +25,8 @@ export default function ApiList() {
|
||||
<TableHead>Token</TableHead>
|
||||
<TableHead>Permission</TableHead>
|
||||
<TableHead>Last used</TableHead>
|
||||
<TableHead className="rounded-tr-xl">Created at</TableHead>
|
||||
<TableHead>Created at</TableHead>
|
||||
<TableHead className="rounded-tr-xl">Action</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -41,6 +43,9 @@ export default function ApiList() {
|
||||
<TableCell>
|
||||
{formatDistanceToNow(apiKey.createdAt, { addSuffix: true })}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<DeleteApiKey apiKey={apiKey} />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
|
Reference in New Issue
Block a user