import { state } from './state.js';
import { UI } from './components.js';
export const Onboarding = {
onComplete: null,
render(onCompleteCallback) {
if (onCompleteCallback) this.onComplete = onCompleteCallback;
const container = document.getElementById('view-container');
container.innerHTML = `
${UI.renderInput('称呼', 'reg-nickname', 'text', '例如:林中鹿', state.registrationData.nickname)}
${UI.renderInput('性别', 'reg-gender', 'text', '自由填写', state.registrationData.gender)}
${UI.renderInput('MBTI', 'reg-mbti', 'text', '如:INFJ', state.registrationData.mbti)}
${UI.renderInput('星座', 'reg-zodiac', 'text', '星辰指引', state.registrationData.zodiac)}
${UI.renderInput('兴趣爱好', 'reg-hobbies', 'text', '用逗号分隔你的热爱', (state.registrationData.hobbies || []).join(','))}
`;
} else if (step === 2) {
html = this.renderMemoryStep('那段纯真的时光', '童年记忆', 'reg-child-text', 'reg-child-date', 'childhood', state.registrationData.childhood);
} else if (step === 3) {
html = this.renderMemoryStep('光芒闪耀的时刻', '开心的经历', 'reg-joy-text', 'reg-joy-date', 'joy', state.registrationData.joy);
} else if (step === 4) {
html = this.renderMemoryStep('在暗夜中潜行', '沮丧与低谷', 'reg-low-text', 'reg-low-date', 'low', state.registrationData.low);
} else if (step === 5) {
html = `
${UI.renderTextArea('对未来的憧憬', 'reg-future-vision', '你想成为一个什么样的人?', state.registrationData.future.vision || '')}
${UI.renderTextArea('理想生活状态', 'reg-future-ideal', '你的理想清晨与傍晚是怎样的?', state.registrationData.future.ideal || '')}
`;
}
content.innerHTML = html;
lucide.createIcons();
},
renderMemoryStep(title, label, textId, dateId, type, data) {
return `