import React, { useState } from 'react'; import { Pencil } from 'lucide-react'; interface EditableSectionProps { title: string; content: string; sectionId: string; businessId: string; isAuthorized: boolean; onUpdate: (newContent: string) => void; } const EditableSection: React.FC = ({ title, content, sectionId, businessId, isAuthorized, onUpdate }) => { const [isEditing, setIsEditing] = useState(false); const [editedContent, setEditedContent] = useState(content); const handleSave = async () => { try { // TODO: Implement API call to save changes onUpdate(editedContent); setIsEditing(false); } catch (error) { console.error('Error saving changes:', error); } }; return (

{title}

{isAuthorized && ( )}
{isEditing ? (