import { t } from "@lingui/macro"; import { CopySimple } from "@phosphor-icons/react"; import { Button, Input, Label, Switch, Tooltip } from "@reactive-resume/ui"; import { AnimatePresence, motion } from "framer-motion"; import { useToast } from "@/client/hooks/use-toast"; import { useUser } from "@/client/services/user"; import { useResumeStore } from "@/client/stores/resume"; import { getSectionIcon } from "../shared/section-icon"; export const SharingSection = () => { const { user } = useUser(); const { toast } = useToast(); const username = user?.username; const setValue = useResumeStore((state) => state.setValue); const slug = useResumeStore((state) => state.resume.slug); const isPublic = useResumeStore((state) => state.resume.visibility === "public"); // Constants const url = `${window.location.origin}/${username}/${slug}`; const onCopy = async () => { await navigator.clipboard.writeText(url); toast({ variant: "success", title: t`A link has been copied to your clipboard.`, description: t`Anyone with this link can view and download the resume. Share it on your profile or with recruiters.`, }); }; return (
{getSectionIcon("sharing")}

{t`Sharing`}

{ setValue("visibility", checked ? "public" : "private"); }} />
{isPublic && (
)}
); };