You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
799 B
TypeScript
29 lines
799 B
TypeScript
import { faEdit } from "@fortawesome/free-solid-svg-icons";
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
import { useRouter } from "next/router";
|
|
import { FC } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
const Edit: FC = () => {
|
|
const { t } = useTranslation("meta");
|
|
const { locale, query } = useRouter();
|
|
|
|
return (
|
|
<div className="mb-4 rounded-lg bg-ctp-mantle p-4 text-sm" role="alert">
|
|
<FontAwesomeIcon icon={faEdit} className="mr-2" />
|
|
<a
|
|
href={`https://github.com/crystal-linux/docs/blob/main/${[
|
|
locale,
|
|
...(query.slug as string[]),
|
|
].join("/")}.mdx`}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
>
|
|
{t("edit_documentation")}
|
|
</a>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Edit;
|