import { UpdateSSHKey } from "@/components/dashboard/settings/ssh-keys/update-ssh-key"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { api } from "@/utils/api"; import { formatDistanceToNow } from "date-fns"; import { KeyRound, KeyRoundIcon, PenBoxIcon } from "lucide-react"; import { AddSSHKey } from "./add-ssh-key"; import { DeleteSSHKey } from "./delete-ssh-key"; export const ShowDestinations = () => { const { data } = api.sshKey.all.useQuery(); return (
SSH Keys Use SSH to beeing able cloning from private repositories. {data?.length === 0 ? (
Add your first SSH Key
) : (
Key
Added
Last Used
{data?.map((sshKey) => (
{sshKey.name} {sshKey.description && ( {sshKey.description} )}
{formatDistanceToNow(new Date(sshKey.createdAt), { addSuffix: true, })}
{sshKey.lastUsedAt ? formatDistanceToNow(new Date(sshKey.lastUsedAt), { addSuffix: true, }) : "Never"}
))}
)}
); };