// This component is abstracted from /event-types/[type] for common usecase. import { PencilIcon } from "@heroicons/react/solid"; import { useState } from "react"; export default function PencilEdit({ value, // eslint-disable-next-line @typescript-eslint/no-empty-function onChange = () => {}, placeholder = "", readOnly = false, }: { value: string; onChange?: (value: string) => void; placeholder?: string; readOnly?: boolean; }) { const [editIcon, setEditIcon] = useState(true); const onDivClick = !readOnly ? () => { return setEditIcon(false); } : // eslint-disable-next-line @typescript-eslint/no-empty-function () => {}; return (
{editIcon ? ( <>

{value}

{!readOnly ? ( ) : null} ) : (
{ setEditIcon(true); onChange(e.target.value); }} />
)}
); }