package ui

// CardProps is the input to the Card templ component.
// Header, Body, and Footer are optional typed regions — nil fields are omitted
// from the rendered output (no empty wrapper divs).
type CardProps struct {
	Header templ.Component
	Body   templ.Component
	Footer templ.Component
}

templ Card(props CardProps) {
	<section class="ui-card">
		if props.Header != nil {
			<div class="ui-card-header">@props.Header</div>
		}
		if props.Body != nil {
			<div class="ui-card-body">@props.Body</div>
		}
		if props.Footer != nil {
			<div class="ui-card-footer">@props.Footer</div>
		}
	</section>
}
