Files
formbricks/packages/ui/GoBackButton/index.tsx
T
Dhruwang Jariwala ab80bc1bf2 feat: language switch (#2692)
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
2024-06-12 14:10:22 +00:00

25 lines
495 B
TypeScript

"use client";
import { ArrowLeftIcon } from "lucide-react";
import { useRouter } from "next/navigation";
import { Button } from "../Button";
export const GoBackButton = ({ url }: { url?: string }) => {
const router = useRouter();
return (
<Button
size="sm"
variant="secondary"
StartIcon={ArrowLeftIcon}
onClick={() => {
if (url) {
router.push(url);
return;
}
router.back();
}}>
Back
</Button>
);
};