@namespace Lumeo.Docs.Shared.Patterns

<Stack Gap="3">
<PatternCard Label="Basic Rating" Code="@_codeBasic">
    <Rating @bind-Value="_rating1" />
</PatternCard>

<PatternCard Label="Half Stars" Code="@_codeHalf">
    <Stack Gap="2">
        <Rating @bind-Value="_rating2" AllowHalf="true" />
        <Lumeo.Text Size="sm" Color="muted" Align="center">@_rating2 / 5</Lumeo.Text>
    </Stack>
</PatternCard>

<PatternCard Label="Read Only" Code="@_codeReadOnly">
    <Rating Value="4" ReadOnly="true" />
</PatternCard>
</Stack>

@code {
    private double _rating1 = 3;
    private double _rating2 = 3.5;

    private string _codeBasic = @"<Rating @bind-Value=""_rating"" />";

    private string _codeHalf = @"<Rating @bind-Value=""_rating"" AllowHalf=""true"" />";

    private string _codeReadOnly = @"<Rating Value=""4"" ReadOnly=""true"" />";
}
