Translate all hardcoded English strings to use i18n translation keys: Components: - TransactionDetailModal: payment details, refunds, technical info - ConnectOnboarding/ConnectOnboardingEmbed: Stripe Connect setup - StripeApiKeysForm: API key management - DomainPurchase: domain registration flow - Sidebar: navigation labels - Schedule/Sidebar, PendingSidebar: scheduler UI - MasqueradeBanner: masquerade status - Dashboard widgets: metrics, capacity, customers, tickets - Marketing: PricingTable, PluginShowcase, BenefitsSection - ConfirmationModal, ServiceList: common UI Pages: - Staff: invitation flow, role management - Customers: form placeholders - Payments: transactions, payouts, billing - BookingSettings: URL and redirect configuration - TrialExpired: upgrade prompts and features - PlatformSettings, PlatformBusinesses: admin UI - HelpApiDocs: API documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
|
|
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { Eye, XCircle } from 'lucide-react';
|
|
import { User } from '../types';
|
|
|
|
interface MasqueradeBannerProps {
|
|
effectiveUser: User;
|
|
originalUser: User;
|
|
previousUser: User | null;
|
|
onStop: () => void;
|
|
}
|
|
|
|
const MasqueradeBanner: React.FC<MasqueradeBannerProps> = ({ effectiveUser, originalUser, previousUser, onStop }) => {
|
|
const { t } = useTranslation();
|
|
|
|
const buttonText = previousUser ? t('platform.masquerade.returnTo', { name: previousUser.name }) : t('platform.masquerade.stopMasquerading');
|
|
|
|
return (
|
|
<div className="bg-orange-600 text-white px-4 py-2 shadow-md flex items-center justify-between z-50 relative">
|
|
<div className="flex items-center gap-3">
|
|
<div className="p-1.5 bg-white/20 rounded-full animate-pulse">
|
|
<Eye size={18} />
|
|
</div>
|
|
<span className="text-sm font-medium">
|
|
{t('platform.masquerade.masqueradingAs')} <strong>{effectiveUser.name}</strong> ({effectiveUser.role})
|
|
<span className="opacity-75 mx-2 text-xs">|</span>
|
|
{t('platform.masquerade.loggedInAs', { name: originalUser.name })}
|
|
</span>
|
|
</div>
|
|
<button
|
|
onClick={onStop}
|
|
className="flex items-center gap-2 px-3 py-1 text-xs font-bold uppercase bg-white text-orange-600 rounded hover:bg-orange-50 transition-colors"
|
|
>
|
|
<XCircle size={14} />
|
|
{buttonText}
|
|
</button>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default MasqueradeBanner;
|