<dialog class="modal" :open="isDialogSetPasswordOpen">
	<div class="modal-box w-96">
		<h3 class="font-bold text-lg mb-4">Change Password</h3>
		<div class="form-control w-full">
			<label class="label">
				<span class="label-text">New Password</span>
			</label>
			<input type="password" x-model="password" class="input input-bordered w-full" placeholder="Enter new password" />
		</div>
		<div class="form-control w-full mt-3">
			<label class="label">
				<span class="label-text">Confirm Password</span>
			</label>
			<input type="password" x-model="confirm_password" class="input input-bordered w-full" placeholder="Confirm new password" />
		</div>
		<div x-show="error" class="alert alert-error mt-3 text-sm">
			<span x-text="error"></span>
		</div>
		<div class="modal-action">
			<button class="btn btn-ghost" @click="closeDialogSetPassword()">Cancel</button>
			<button class="btn btn-primary" @click="savePassword('<?=session('userid'); ?>')" :disabled="isLoading">
				<span x-show="isLoading" class="loading loading-spinner loading-sm"></span>
				Save
			</button>
		</div>
	</div>
	<div class="modal-backdrop bg-black/30" @click="closeDialogSetPassword()"></div>
</dialog>
