{# Nostr user homepage template. Lists profile metadata and recent posts #}
{%- if let Some(meta) = metadata %}
{# We have the metadata. Use the account's display name as the top header, or the name as fallback #}
{%- if let Some(display_name) = meta.display_name && !display_name.is_empty() %}
# {{ display_name }}
{%- else if let Some(name) = meta.name && !name.is_empty() %}
# {{ name }}
{%- endif %}
## {{ npub }}
{%- if let Some(banner) = meta.banner %}
=> /www/get_image.png?{{self::encode(banner)}}  {{ self::t!("banner") }}
{%- endif %}
{%- if let Some(picture_url) = meta.picture %}
=> /www/get_image.png?{{self::encode(picture_url)}}  {{ self::t!("picture") }}
{%- endif %}
{%- if let Some(nip05) = meta.nip05 && !nip05.is_empty() %}
nip05: {{ nip05 }}
{%- endif %}
{%- if let Some(about) = meta.about %}
### About me
{{ about }}
{%- endif %}
{%- if let Some(website) = meta.website %}
=> {{ website }} Website
{%- endif %}
{%- else %}
{# No metadata in the database for this npub #}
{{ self::t!("no_meta_for_npub") }}
{%- endif %}
{{ self::EMOJI_KEY }} npub (bech32): {{npub}}
=> /p/{{npub}}/follow {{ self::EMOJI_BELL }} {{ self::t!("follow") }}
=> /p/{{npub}}/unfollow {{ self::EMOJI_BELL_SLASH }} {{ self::t!("unfollow") }}
=> /p/{{npub}}/mute {{ self::EMOJI_MUTE }} {{ self::t!("mute") }}
=> /p/{{npub}}/unmute {{ self::t!("unmute") }}
=> /p/{{npub}}/send_dm {{ self::EMOJI_CHAT }} {{ self::t!("send_dm") }}
=> /p/{{npub}}/conversation {{ self::EMOJI_CHAT }} {{ self::t!("private_messages") }}

{%- if let Some(notes) = notes_blocks %}
{{ self::gem(notes) }}
{%- endif %}
