@using Iceshrimp.Shared.Schemas
@* ReSharper disable once RedundantUsingDirective *@
@using Iceshrimp.Frontend.Components.Note
@inject NavigationManager NavigationManager
@if (_indented)
{

@if (Note.Descendants?.Count > 0)
{
}
}
@if (Note.Descendants != null)
{
@* We are checking for null 3 lines up. *@
@for (int i = 0; i < Note.Descendants!.Count; i++)
{
var note = Note.Descendants[i];
@if (Note.Descendants?.Count > 1)
{
@if (i == Note.Descendants.Count - 1)
{
}else
{
}
} else
{
}
}
}
@code {
[Parameter] [EditorRequired] public required NoteResponse Note { get; set; }
[Parameter] [EditorRequired] public required int Depth { get; set; }
private bool _indented = false;
protected override void OnInitialized()
{
if (Depth > 0 || Note.Descendants?.Count > 0)
{
_indented = true;
}
}
private void OpenNote()
{
NavigationManager.NavigateTo($"/notes/{Note.Id}");
}
}