class WeatherArtsController < ApplicationController
  def show
    @city = City.friendly.find(params[:city_id])
    @weather_art = @city.weather_arts.friendly.find(params[:slug])

    ahoy.track "View Weather Art", {
      weather_art_id: @weather_art.id,
      city_id: @weather_art.city_id,
      event_type: "weather_art_view"
    }
    ahoy.track "View City", {
      city_id: @city.id,
      name: @city.name,
      event_type: "city_view"
    }

    set_meta_tags(
      title: "#{@city.name} Weather Art - #{@weather_art.weather_date.strftime('%B %d, %Y')}",
      description: "#{@city.name}'s weather visualized through AI art. #{@weather_art.description} at #{@weather_art.temperature}°C.",
      keywords: "#{@city.name}, weather art, #{@weather_art.description}, AI visualization",
      og: {
        image: @weather_art.image.attached? ? url_for(@weather_art.image) : nil
      }
    )
  end
end