mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-21 19:39:28 -05:00
ab80bc1bf2
Co-authored-by: Johannes <johannes@formbricks.com> Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
25 lines
495 B
TypeScript
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>
|
|
);
|
|
};
|