diff --git a/vault/components/privacy-toggle.tsx b/vault/components/privacy-toggle.tsx new file mode 100644 index 0000000..ac82854 --- /dev/null +++ b/vault/components/privacy-toggle.tsx @@ -0,0 +1,74 @@ +"use client"; + +import { motion } from "framer-motion"; +import { Lock, Link as LinkIcon } from "lucide-react"; +import { Input } from "@/components/ui/input"; +import { PrivacyType } from "@/lib/types"; +import { cn } from "@/lib/utils"; + +interface PrivacyToggleProps { + value: PrivacyType; + onChange: (value: PrivacyType) => void; + password: string; + onPasswordChange: (password: string) => void; + passwordPlaceholder?: string; +} + +export function PrivacyToggle({ + value, + onChange, + password, + onPasswordChange, + passwordPlaceholder = "Enter a password...", +}: PrivacyToggleProps) { + return ( +
+
+ + +
+ + {value === "password" && ( + + onPasswordChange(e.target.value)} + className="mt-3 h-10 bg-muted/50 border-border/50 focus:border-amber-500/50" + /> + + )} +
+ ); +}