40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
@inherits DComponentBase
|
|||
|
|
|
||
|
|
@* daisyUI Divider: https://daisyui.com/components/divider/ . Leave ChildContent empty for a blank line. *@
|
||
|
|
<div @attributes="AdditionalAttributes" class="@CssClass">@ChildContent</div>
|
||
|
|
|
||
|
|
@code {
|
||
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||
|
|
[Parameter] public DColor Color { get; set; }
|
||
|
|
[Parameter] public DDividerDirection Direction { get; set; }
|
||
|
|
[Parameter] public DDividerPlacement Placement { get; set; }
|
||
|
|
|
||
|
|
string CssClass => Cx("divider", DirectionClass, ColorClass, PlacementClass, Class);
|
||
|
|
|
||
|
|
string DirectionClass => Direction switch
|
||
|
|
{
|
||
|
|
DDividerDirection.Horizontal => "divider-horizontal",
|
||
|
|
DDividerDirection.Vertical => "divider-vertical",
|
||
|
|
_ => null
|
||
|
|
};
|
||
|
|
|
||
|
|
string ColorClass => Color switch
|
||
|
|
{
|
||
|
|
DColor.Neutral => "divider-neutral",
|
||
|
|
DColor.Primary => "divider-primary",
|
||
|
|
DColor.Secondary => "divider-secondary",
|
||
|
|
DColor.Accent => "divider-accent",
|
||
|
|
DColor.Info => "divider-info",
|
||
|
|
DColor.Success => "divider-success",
|
||
|
|
DColor.Warning => "divider-warning",
|
||
|
|
DColor.Error => "divider-error",
|
||
|
|
_ => null
|
||
|
|
};
|
||
|
|
|
||
|
|
string PlacementClass => Placement switch
|
||
|
|
{
|
||
|
|
DDividerPlacement.Start => "divider-start",
|
||
|
|
DDividerPlacement.End => "divider-end",
|
||
|
|
_ => null
|
||
|
|
};
|
||
|
|
}
|