Files
sendou.ink/app/components/BackLink.tsx
Kalle f40fdb5f26
Some checks failed
E2E Tests / e2e (push) Has been cancelled
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled
Weapon landing flow for builds/analyzer/obj dmg calc (#3437)
2026-10-03 16:23:18 +03:00

22 lines
671 B
TypeScript

import clsx from "clsx";
import { ArrowLeft } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Link, type LinkProps } from "react-router";
import styles from "./BackLink.module.css";
/** Pill shaped link with a leading arrow, for navigating back up to a parent view. Says "Back" unless given children. */
export function BackLink({
className,
children,
...rest
}: Omit<LinkProps, "className"> & { className?: string }) {
const { t } = useTranslation(["common"]);
return (
<Link {...rest} className={clsx(styles.backLink, className)}>
<ArrowLeft className={styles.icon} />
{children ?? t("common:actions.back")}
</Link>
);
}