import type { FC } from "react";
import { Link } from "@modern-js/runtime/router";
import { useTranslation } from "@/i18n/provider.js";
import "./DetailsBackButton.scss";

export interface DetailsBackButtonProps {
  locale: string;
}

export const DetailsBackButton: FC<DetailsBackButtonProps> = ({ locale }) => {
  const { t } = useTranslation();
  return (
    <Link
      to={`/${locale}/onlineboard`}
      className="details-back-button"
      data-testid="details-back-button"
    >
      <span className="details-back-button__arrow" aria-hidden="true">
        {"\u2190"}
      </span>
      <span>{t("SHARED.BACK-BOARD")}</span>
    </Link>
  );
};
