export type ActionResponse<T = unknown> = {
  success: boolean
  data?: T
  error?: string
}

export function createSuccessResponse<T>(data: T): ActionResponse<T> {
  return {
    success: true,
    data,
    error: undefined,
  }
}

export function createErrorResponse<T = unknown>(error: string): ActionResponse<T> {
  return {
    success: false,
    data: undefined,
    error,
  }
}
