Skip to content

Commit 6031277

Browse files
committed
✏️ Update CodeSnippet.razor content
- Modified the content of CodeSnippet.razor to enhance clarity. - Improved the structure for better readability and usability. - Ensured consistency with existing code standards. Generated by Copilot
1 parent b6b80e6 commit 6031277

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

TestArena/Blog/Common/CodeSnippet.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<code class="language-@Language" style="font-size: 0.8rem;">@ChildContent</code>
88
</pre>
99
</div>
10-
@if (ShowDescription)
10+
@if (Number > 0 && !string.IsNullOrEmpty(Description))
1111
{
1212
<div class="col-12 text-center">
1313
<code>@(Number > 0 ? $"Code Sample #{Number.ToString()} : " : string.Empty)@Description</code>
@@ -22,7 +22,7 @@
2222
[Parameter] public string Language { get; set; } = "csharp"; // Default to C#
2323
[Parameter] public int Number { get; set; } = 0; // Default to C#
2424
[Parameter] public string Description { get; set; } = ""; // Default to C#
25-
[Parameter] public bool ShowDescription { get => Number > 0 && !string.IsNullOrWhiteSpace(Description); }
25+
[Parameter] public bool ShowDescription { get; set; }
2626

2727
protected override async Task OnAfterRenderAsync(bool firstRender)
2828
{

0 commit comments

Comments
 (0)