{#- chirp-ui: Share Menu component Dropdown with copy link, share to X/FB/etc (links). Extends dropdown. Usage: from "chirpui/share_menu.html" import share_menu share_menu(label="Share", share_url="https://example.com/post/1") # Or with custom links: call share_menu(label="Share") Share on X Share on Facebook end -#} {% from "chirpui/dropdown.html" import dropdown %} {% def share_menu(label="Share", share_url=none, cls="") %} {% if share_url and caller is not defined %} {% call dropdown(label=label, cls="chirpui-share-menu " ~ (cls or "")) %} Copy link Share on X Share on Facebook {% end %} {% else %} {% call dropdown(label=label, cls="chirpui-share-menu " ~ (cls or "")) %} {{ caller() }} {% end %} {% end %} {% end %}