package tablecomponent

templ TableV2(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string, inputanSearch templ.Component) {
	if len(thName) != len(thWidth) {
		<div>length array thname berbeda dengan array thwidth</div>
	} else {
		@inputanSearch
		<div id={ idunique }>
			<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 {
							<th scope="col" width={ thWidth[i] }>{ item }</th>
						}
					</tr>
				</thead>
				<tbody>
					@trComponent
				</tbody>
			</table>
			<div>
				@pagination
			</div>
		</div>
	}
}

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