tradewithlive / src /config /data.ts
SherlockHolmes786's picture
Upload 27 files
e9a8d0a verified
Raw History Blame Contribute Delete
1.15 kB
import { Influencer } from '../types';
// Get all influencers from localStorage (approved ones only)
export const getInfluencers = (): Influencer[] => {
try {
const approvedInfluencers = JSON.parse(localStorage.getItem('approved_influencers') || '[]');
// Convert approved registrations to Influencer format
const approvedAsInfluencers: Influencer[] = approvedInfluencers.map((reg: any) => ({
id: reg.id,
name: reg.name,
avatar: reg.avatar || reg.name.charAt(0).toUpperCase(),
bio: reg.bio || '',
socialLinks: reg.socialLinks?.twitter || reg.socialLinks?.youtube || '',
isPrivate: reg.isPrivate,
accessCode: reg.accessCode || '',
stats: {
winRate: 0,
totalPnlPercent: 0,
activePositions: 0,
netWorthAllocation: '$0'
}
}));
return approvedAsInfluencers;
} catch (error) {
console.error('Error loading approved influencers:', error);
return [];
}
};
// Empty array for backward compatibility
export const influencers: Influencer[] = [];
// Empty initial data object
export const initialData: Record<string, any> = {};