import React, { useState, useRef } from 'react';
import {
Instagram,
Youtube,
Github,
Twitter,
Facebook,
Link as LinkIcon,
Plus,
Trash2,
User,
ExternalLink,
Settings,
Image as ImageIcon,
Smartphone,
Eye,
Upload,
RefreshCw
} from 'lucide-react';
const App = () => {
// --- Refs ---
const fileInputRef = useRef(null);
// --- State ---
const [profile, setProfile] = useState({
name: "김철수",
bio: "프론트엔드 개발자 | 일상의 기록을 공유합니다.",
avatar: "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200&h=200&fit=crop"
});
const [socialLinks, setSocialLinks] = useState([
{ id: '1', platform: 'instagram', url: 'https://instagram.com' },
{ id: '2', platform: 'youtube', url: 'https://youtube.com' },
{ id: '3', platform: 'github', url: 'https://github.com' }
]);
const [links, setLinks] = useState([
{
id: '1',
title: '나의 포트폴리오',
description: '최신 프로젝트와 기술 스택 확인하기',
url: 'https://portfolio.com',
icon: 'Link'
},
{
id: '2',
title: '최신 블로그 포스트',
description: 'React와 Tailwind CSS에 관한 기술 블로그',
url: 'https://blog.com',
icon: 'Link'
}
]);
const [viewMode, setViewMode] = useState('editor');
// --- Handlers ---
const handleImageUpload = (e) => {
const file = e.target.files[0];
if (file) {
const reader = new FileReader();
reader.onloadend = () => {
setProfile({ ...profile, avatar: reader.result });
};
reader.readAsDataURL(file);
}
};
const triggerFileInput = () => {
fileInputRef.current.click();
};
const addSocialLink = () => {
const newId = Date.now().toString();
setSocialLinks([...socialLinks, { id: newId, platform: 'instagram', url: '' }]);
};
const removeSocialLink = (id) => {
setSocialLinks(socialLinks.filter(link => link.id !== id));
};
const updateSocialLink = (id, field, value) => {
setSocialLinks(socialLinks.map(link => link.id === id ? { ...link, [field]: value } : link));
};
const addLink = () => {
const newId = Date.now().toString();
setLinks([...links, { id: newId, title: '새 링크', description: '', url: '', icon: 'Link' }]);
};
const removeLink = (id) => {
setLinks(links.filter(link => link.id !== id));
};
const updateLink = (id, field, value) => {
setLinks(links.map(link => link.id === id ? { ...link, [field]: value } : link));
};
// --- Icons Mapping ---
const getSocialIcon = (platform) => {
switch (platform) {
case 'instagram': return
{profile.bio}
{link.description}
}강사님만의 특별한 페이지를 만들어보세요.
PC에서 사진을 선택하여 실제 강사님의 모습을 보여주세요.