mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 15:35:35 +00:00
* feat(wip): translation * fix: some i18n errors + use ssr translation * fix: i18next implementation * fix: tsc errors * feat: i18n middleware * feat: translate link view home page * feat: translate quick actions * feat: translate search modal * feat: translate side menu * feat: native error boundary + translation * feat: translate error pages * feat: translate category forms * feat: translate link forms * refactor: LangSelector is no longer absolute by default
31 lines
722 B
TypeScript
31 lines
722 B
TypeScript
import LinkTag from "next/link";
|
|
import { useTranslation } from "next-i18next";
|
|
import { AiOutlineEdit } from "react-icons/ai";
|
|
import { Category, Link } from "types";
|
|
import styles from "./quickactions.module.scss";
|
|
|
|
export default function EditItem({
|
|
type,
|
|
id,
|
|
onClick,
|
|
className = "",
|
|
}: {
|
|
type: "category" | "link";
|
|
id: Link["id"] | Category["id"];
|
|
onClick?: (event: any) => void;
|
|
className?: string;
|
|
}) {
|
|
const { t } = useTranslation("home");
|
|
|
|
return (
|
|
<LinkTag
|
|
href={`/${type}/edit/${id}`}
|
|
title={t(`common:${type}.edit`)}
|
|
className={`${styles["action"]} ${className ? className : ""}`}
|
|
onClick={onClick && onClick}
|
|
>
|
|
<AiOutlineEdit />
|
|
</LinkTag>
|
|
);
|
|
}
|