'use client';

import { EditableTitle } from './EditableTitle';
import { updateMotivatorSession } from '@/actions/moving-motivators';

interface EditableMotivatorTitleProps {
  sessionId: string;
  initialTitle: string;
  isOwner: boolean;
}

export function EditableMotivatorTitle({
  sessionId,
  initialTitle,
  isOwner,
}: EditableMotivatorTitleProps) {
  return (
    <EditableTitle
      sessionId={sessionId}
      initialTitle={initialTitle}
      isOwner={isOwner}
      onUpdate={async (id, title) => {
        const result = await updateMotivatorSession(id, { title });
        return result;
      }}
    />
  );
}

