Openstatus
www.openstatus.dev
1import { ChevronLeft } from "lucide-react";
2import type { LinkProps } from "next/link";
3import Link from "next/link";
4
5import { Button } from "@openstatus/ui/src/components/button";
6
7interface BackButtonProps extends LinkProps {
8 children?: React.ReactNode;
9}
10
11export const BackButton = ({ href, children }: BackButtonProps) => {
12 return (
13 <Button variant="link" asChild>
14 <Link href={href} className="group mb-1">
15 <ChevronLeft className="mr-1 h-4 w-4 text-muted-foreground group-hover:text-foreground" />{" "}
16 {children || "Back"}
17 </Link>
18 </Button>
19 );
20};