mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
19 lines
696 B
TypeScript
19 lines
696 B
TypeScript
|
import { faBinoculars, faPencil } from "@fortawesome/free-solid-svg-icons"
|
||
|
import { useTranslation } from "next-i18next"
|
||
|
import { EditingContext } from "../../contexts/editing"
|
||
|
import { useDefinedContext } from "../../utils/definedContext"
|
||
|
import { FestaIcon } from "../extensions/FestaIcon"
|
||
|
|
||
|
export function ToolToggleEditing() {
|
||
|
const {t} = useTranslation()
|
||
|
const [editing, setEditing] = useDefinedContext(EditingContext)
|
||
|
|
||
|
return (
|
||
|
<button
|
||
|
aria-label={editing ? t("toggleEditingView") : t("toggleEditingEdit")}
|
||
|
onClick={() => setEditing(!editing)}
|
||
|
>
|
||
|
<FestaIcon icon={editing ? faBinoculars : faPencil}/>
|
||
|
</button>
|
||
|
)
|
||
|
}
|