import SwiftUI

{% macro render_entries(entries, indent) -%}
{% for entry in entries -%}
{% if entry.kind == "namespace" -%}
{{ indent }}{{ access_level }} enum {{ entry.swiftIdentifier }} {
{{ render_entries(entry.children, indent ~ "    ") }}{{ indent }}}
{% elif entry.kind == "color" -%}
{{ indent }}{{ access_level }} static let {{ entry.swiftIdentifier | lower_first }} = ColorAsset(name: {{ entry.properties.assetName | string_literal }})
{% elif entry.kind == "image" -%}
{{ indent }}{{ access_level }} static let {{ entry.swiftIdentifier | lower_first }} = ImageAsset(name: {{ entry.properties.assetName | string_literal }})
{% endif -%}
{% endfor -%}
{%- endmacro %}

{% for module in modules %}
{{ access_level }} enum {{ module.name }} {
{{ render_entries(module.entries, "    ") }}}

{% endfor %}
{{ access_level }} struct ColorAsset {
    {{ access_level }} let name: String
}

{{ access_level }} struct ImageAsset {
    {{ access_level }} let name: String
}
