'use client';

import { EditableTitle } from './EditableTitle';
import { updateSessionTitle } from '@/actions/session';

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

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

