"use server"

import { hasCompletedOnboarding, markUserCompletedOnboarding } from "@codeflash-ai/common"

/**
 * Server-side wrapper for checking onboarding status
 */
export async function checkUserOnboardingStatus(user_id: string): Promise<boolean> {
  try {
    // Use the imported function with a new name
    return await hasCompletedOnboarding(user_id)
  } catch (error) {
    console.error("Error checking onboarding status:", error)
    return false // Default to false on error
  }
}

/**
 * Server-side wrapper for marking onboarding as completed
 */
export async function completeUserOnboarding(user_id: string): Promise<void> {
  try {
    // Use the imported function with a new name
    await markUserCompletedOnboarding(user_id)
  } catch (error) {
    console.error("Error marking onboarding as completed:", error)
    throw error
  }
}
