Files
my-links/src/components/QuickActions/EditItem.tsx
Sonny 255f50080a Add translation (#9)
* 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
2023-11-11 00:08:30 +01:00

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>
);
}