import React, { useState } from 'react'; import { useTheme } from '../contexts/ThemeContext'; import { useAuth } from '../contexts/AuthContext'; import { useOrg } from '../contexts/OrgContext'; import { Card, Button } from '../components/UiKit'; import { Theme } from '../types'; const HelpAndSettings: React.FC = () => { const { theme, setTheme } = useTheme(); const { user, signOutUser } = useAuth(); const { org, upsertOrg, issueInviteViaApi } = useOrg(); const [activeTab, setActiveTab] = useState<'settings' | 'help'>('settings'); const [inviteForm, setInviteForm] = useState({ name: '', email: '', role: '', department: '' }); const [isInviting, setIsInviting] = useState(false); const [inviteResult, setInviteResult] = useState(null); const handleLogout = async () => { try { await signOutUser(); } catch (error) { console.error('Logout error:', error); } }; const handleRestartOnboarding = async () => { try { await upsertOrg({ onboardingCompleted: false }); // The RequireOnboarding component will redirect automatically } catch (error) { console.error('Failed to restart onboarding:', error); } }; const handleInviteEmployee = async () => { if (!inviteForm.name.trim() || !inviteForm.email.trim() || isInviting) return; setIsInviting(true); setInviteResult(null); try { const result = await issueInviteViaApi({ name: inviteForm.name.trim(), email: inviteForm.email.trim(), role: inviteForm.role.trim() || undefined, department: inviteForm.department.trim() || undefined }); setInviteResult(`Invitation sent! Share this link: ${result.inviteLink}`); setInviteForm({ name: '', email: '', role: '', department: '' }); } catch (error) { console.error('Failed to send invitation:', error); setInviteResult('Failed to send invitation. Please try again.'); } finally { setIsInviting(false); } }; const renderSettings = () => (

Appearance

Organization

Company:
{org?.name}
Onboarding:
{org?.onboardingCompleted ? 'Completed' : 'Incomplete'}

This will reset your company profile and require you to complete the setup process again.

Invite Employee

setInviteForm(prev => ({ ...prev, name: e.target.value }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="John Doe" />
setInviteForm(prev => ({ ...prev, email: e.target.value }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="john.doe@company.com" />
setInviteForm(prev => ({ ...prev, role: e.target.value }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Senior Developer" />
setInviteForm(prev => ({ ...prev, department: e.target.value }))} className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Engineering" />
{inviteResult && (
{inviteResult}
)}

The invited employee will receive an email with instructions to join your organization.

Account

Email:
{user?.email}
User ID:
{user?.uid}

Data & Privacy

); const renderHelp = () => (

Getting Started

1. Set up your organization

Complete the onboarding process to configure your company information and preferences.

2. Add employees

Invite team members and add their basic information to start generating reports.

3. Generate reports

Use AI-powered reports to gain insights into employee performance and organizational health.

Frequently Asked Questions

How do I add new employees?

Go to the Reports page and use the "Add Employee" button to invite new team members.

How are reports generated?

Reports use AI to analyze employee data and provide insights on performance, strengths, and development opportunities.

Is my data secure?

Yes, all data is encrypted and stored securely. We follow industry best practices for data protection.

Contact Support

); return (

Help & Settings

Manage your account and get help

{activeTab === 'settings' ? renderSettings() : renderHelp()}
); }; export default HelpAndSettings;