@using CommunityToolkit.Maui.Alerts @inject IJSRuntime JS
@* TODO: link to paste view *@ @Paste.RelativeTime @if(MarkupView){
@Utilities.MdToHtmlMarkup(Paste.Content)
} else {
@((MarkupString)Paste.Content)
}
@code { [Parameter] public Paste? Paste { get; set; } [Parameter] public bool Editable { get; set; } = false; [Parameter] public EditPasteDialog? Dialog { get; set; } private bool MarkupView = false; private async Task EditPaste(EventArgs e) { Dialog!.Paste = Paste; await InvokeAsync(StateHasChanged); await JS.InvokeVoidAsync("ui", "#" + Dialog?.id); } public async Task ShareClick(EventArgs e) { await Share.Default.RequestAsync(new ShareTextRequest { Uri = Paste!.Url, Text = Paste!.Content, Title = Paste!.Title, Subject = Paste!.Title }); } public async Task CopyPaste() { if(Paste != null && !string.IsNullOrEmpty(Paste?.Content)) { await Clipboard.Default.SetTextAsync(Paste?.Content); var toast = Toast.Make("Copied to clipboard"); await toast.Show(); } } }