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