
{% if twitter_user %}
<form class="compose" hx-post="{{ url_for('twitter_v2_facade.post_tweets_create', me=me) }}" hx-swap="outerHTML">
{% else %}
<form class="compose" hx-post="{{ url_for('.post_tweets_create', me=me) }}" hx-swap="outerHTML">
{% endif %}

<h2>Compose</h2>
<ul>
	<li><textarea name="text" placeholder="Only the finest..." style="width: 100%" onchange="this.onkeyup()" onkeyup="this.form.querySelector('.compose-length').innerHTML = this.value.length" rows="6" cols="30"></textarea>
	<li><p class="compose-length w-100" style="text-align: right">0</p>
	<li><input type="text" name="reply_to_tweet_id" placeholder="Reply to Tweet ID" style="width: 100%">
	<li><input type="text" name="quote_tweet_id" placeholder="Quote Tweet ID" style="width: 100%">
	<li><button type="submit" style="margin-top: 0.33em">Post</button>
</ul>

{% if new_tweet_id %}
<script>
Toast.fire({
  icon: 'success',
  title: 'Tweet was sent; <a style="text-align: right" href="{{ url_for('.get_tweet_html', tweet_id=new_tweet_id) }}">View</a>.'
});
</script>
{% endif %}
</form>