package tablecomponent

templ Table(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component) {
	if len(thName) != len(thWidth) {
		<div>length array thname berbeda dengan array thwidth</div>
	} else {
		<div>
			<table class="table table-hover table-borderless">
				<thead>
					<tr class="rounded-lg bg-header-table">
						for i, item := range thName {
							<th scope="col" width={ thWidth[i] }>{ item }</th>
						}
					</tr>
				</thead>
				<tbody>
					@trComponent
				</tbody>
			</table>
		</div>
		<div>
			@pagination
		</div>
	}
}
