vaulterm/frontend/pages/hosts/components/credentials-section.tsx

29 lines
748 B
TypeScript
Raw Normal View History

2024-11-09 14:37:09 +00:00
import Icons from "@/components/ui/icons";
2024-11-09 18:57:36 +00:00
import { keyFormModal } from "@/pages/keychains/components/form";
import { initialValues as keychainInitialValues } from "@/pages/keychains/schema/form";
2024-11-09 14:37:09 +00:00
import React from "react";
import { Button, Label, XStack } from "tamagui";
2024-11-09 18:57:36 +00:00
type Props = {
type?: "user" | "rsa" | "pve" | "cert";
};
export default function CredentialsSection({ type = "user" }: Props) {
2024-11-09 14:37:09 +00:00
return (
<XStack gap="$3">
<Label flex={1} h="$3">
Credentials
</Label>
2024-11-09 18:57:36 +00:00
<Button
size="$3"
icon={<Icons size={16} name="plus" />}
onPress={() =>
keyFormModal.onOpen({ ...keychainInitialValues, type } as never)
}
>
2024-11-09 14:37:09 +00:00
Add
</Button>
</XStack>
);
}