24 lines
683 B
Plaintext
24 lines
683 B
Plaintext
@using Microsoft.AspNetCore.Components.Web
|
|
<div class="flex gap-2 w-full mt-4">
|
|
<input type="text" @bind="_url" @bind:event="oninput" placeholder="Add YouTube, Vimeo or Image URL..."
|
|
class="input input-bordered flex-1" />
|
|
|
|
<button type="button" class="btn btn-primary" @onclick="AddLink" disabled="@string.IsNullOrWhiteSpace(_url)">
|
|
Add Link
|
|
</button>
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] public EventCallback<string> OnLinkAdded { get; set; }
|
|
|
|
private string _url = "";
|
|
|
|
private async Task AddLink()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(_url))
|
|
{
|
|
await OnLinkAdded.InvokeAsync(_url);
|
|
_url = "";
|
|
}
|
|
}
|
|
} |