import { Trans } from "@lingui/react/macro"; import { PasswordIcon, PencilSimpleLineIcon } from "@phosphor-icons/react"; import { Link, useNavigate } from "@tanstack/react-router"; import { motion } from "motion/react"; import { useCallback, useMemo } from "react"; import { match } from "ts-pattern"; import { Button } from "@reactive-resume/ui/components/button"; import { useDialogStore } from "@/dialogs/store"; import { useAuthAccounts } from "./hooks"; export function PasswordSection() { const navigate = useNavigate(); const { openDialog } = useDialogStore(); const { hasAccount } = useAuthAccounts(); const hasPassword = useMemo(() => hasAccount("credential"), [hasAccount]); const handleUpdatePassword = useCallback(() => { if (hasPassword) { openDialog("auth.change-password", undefined); } else { void navigate({ to: "/auth/forgot-password" }); } }, [hasPassword, navigate, openDialog]); return (

Password

{match(hasPassword) .with(true, () => ( )) .with(false, () => (