'use client';

import { EditableTitle } from './EditableTitle';
import { updateWeatherSession } from '@/actions/weather';

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

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