"use client";
import { useEffect } from "react";
import { init } from "@oppla-ai/feedback"
interface FeedbackProps {
name?: string;
email?: string;
id?: string;
phone_number?: string;
job_title?: string;
}
export const Feedback = ({
name,
email,
id,
phone_number,
job_title
}: FeedbackProps) => {
useEffect(() => {
const properties = {
name: name || "",
email: email || "",
id: id || "",
phone_number: phone_number || "",
job_title: job_title || ""
};
try {
init({
organizationId: "YOUR_ORGANIZATION_ID",
websiteId: "YOUR_WEBSITE_ID",
properties
});
} catch (error) {
console.error('Error initializing feedback:', error);
}
}, [name, email, id, phone_number, job_title])
return null;
};