'use client'; import { DotsThreeVertical, PencilSimple, Plus, Trash } from '@phosphor-icons/react'; import { Menu } from '@base-ui/react/menu'; import { Button } from '@/components/ui/button'; interface SectionEditorProps { isOwnProfile?: boolean; sectionTitle: string; onAdd?: () => void; children: React.ReactNode; } export function SectionEditor({ isOwnProfile, sectionTitle, onAdd, children }: SectionEditorProps) { if (!isOwnProfile) return <>{children}; return (
{children} {onAdd && (
)}
); } interface EditableEntryProps { isOwnProfile?: boolean; onEdit: () => void; onDelete: () => void; entryLabel: string; children: React.ReactNode; /** Optional content (e.g. star toggle) to render before the kebab menu */ trailingContent?: React.ReactNode; } export function EditableEntry({ isOwnProfile, onEdit, onDelete, entryLabel, children, trailingContent, }: EditableEntryProps) { if (!isOwnProfile) return <>{children}; return (
{children}
{trailingContent}
); }