import { Icon, Icons } from "@/components/Icon"; import { useAutoAnimate } from "@formkit/auto-animate/react"; import { useCallback } from "react"; import { useTranslation } from "react-i18next"; import { ButtonControl } from "./ButtonControl"; export interface EditButtonProps { editing: boolean; onEdit?: (editing: boolean) => void; } export function EditButton(props: EditButtonProps) { const { t } = useTranslation() const [parent] = useAutoAnimate(); const onClick = useCallback(() => { props.onEdit?.(!props.editing); }, [props]); return ( {props.editing ? ( {t("media.stopEditing")} ) : ( )} ); }