'use client';

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

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

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

