mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-21 03:31:20 -05:00
50407498ec
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
26 lines
496 B
TypeScript
26 lines
496 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>
|
|
);
|
|
};
|