package tablecomponent

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

templ DivEmptyV3() {
	<div></div>
}
