'use client';

import { EditableTitle } from './EditableTitle';
import { updateYearReviewSession } from '@/actions/year-review';

interface EditableYearReviewTitleProps {
  sessionId: string;
  initialTitle: string;
  canEdit: boolean;
}

export function EditableYearReviewTitle({
  sessionId,
  initialTitle,
  canEdit,
}: EditableYearReviewTitleProps) {
  return (
    <EditableTitle
      sessionId={sessionId}
      initialTitle={initialTitle}
      canEdit={canEdit}
      onUpdate={async (id, title) => {
        const result = await updateYearReviewSession(id, { title });
        return result;
      }}
    />
  );
}

