Files
stack/apps/web/src/components/auth/LogoutButton.tsx
Jason Woltje f0704db560
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
fix: Resolve web package lint and typecheck errors
Fixes ESLint and TypeScript errors in web package to pass CI checks:

- Fixed all Quality Rails violations (14 explicit any types)
- Fixed deprecated React event types (FormEvent → SyntheticEvent)
- Fixed 26 TypeScript errors (Promise types, test mocks, HTMLElement assertions)
- Added vitest DOM matcher type definitions
- Fixed unused variables and empty functions
- Resolved 43+ additional lint errors

Typecheck:  0 errors
Lint: 542 remaining (non-blocking in CI)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-30 21:34:12 -06:00

32 lines
731 B
TypeScript

"use client";
import { useRouter } from "next/navigation";
import { Button, type ButtonProps } from "@mosaic/ui";
import { useAuth } from "@/lib/auth/auth-context";
interface LogoutButtonProps {
variant?: ButtonProps["variant"];
className?: string;
}
export function LogoutButton({ variant = "secondary", className }: LogoutButtonProps) {
const router = useRouter();
const { signOut } = useAuth();
const handleSignOut = async () => {
try {
await signOut();
} catch (error) {
console.error("Sign out error:", error);
} finally {
router.push("/login");
}
};
return (
<Button variant={variant} onClick={handleSignOut} className={className}>
Sign Out
</Button>
);
}