2026-04-12 20:03:20 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import { createRoot } from 'react-dom/client';
|
|
|
|
|
import ProfileCharts from './components/ProfileCharts';
|
|
|
|
|
import BattleDialog from './components/BattleDialog';
|
2026-04-13 15:50:28 +02:00
|
|
|
import AvatarUpload from './components/AvatarUpload';
|
|
|
|
|
|
|
|
|
|
const avatarRoot = document.getElementById('profile-avatar-root');
|
|
|
|
|
if (avatarRoot) {
|
|
|
|
|
const { uploadUrl, thumbUrl, initials } = avatarRoot.dataset;
|
|
|
|
|
createRoot(avatarRoot).render(
|
|
|
|
|
<AvatarUpload
|
|
|
|
|
uploadUrl={uploadUrl}
|
|
|
|
|
initialThumbUrl={thumbUrl || null}
|
|
|
|
|
initials={initials}
|
|
|
|
|
/>,
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-04-12 20:03:20 +02:00
|
|
|
|
|
|
|
|
const chartsRoot = document.getElementById('profile-charts-root');
|
|
|
|
|
if (chartsRoot) {
|
|
|
|
|
createRoot(chartsRoot).render(
|
|
|
|
|
<ProfileCharts chartData={JSON.parse(chartsRoot.dataset.chartData)} />,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const battleRoot = document.getElementById('profile-battle-root');
|
|
|
|
|
if (battleRoot) {
|
|
|
|
|
createRoot(battleRoot).render(
|
|
|
|
|
<BattleDialog games={JSON.parse(battleRoot.dataset.games)} />,
|
|
|
|
|
);
|
|
|
|
|
}
|