From e6435c1c669f7ec432dbb1b928dde38f3a92712d Mon Sep 17 00:00:00 2001 From: gahusb Date: Tue, 28 Apr 2026 08:07:41 +0900 Subject: [PATCH] =?UTF-8?q?chore(shell):=20Sidebar.tsx=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20(=EC=82=AC=EC=9A=A9=EC=B2=98=200)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DashboardShell에서 사이드바 분기를 제거하면서 Sidebar 컴포넌트는 더 이상 어디에서도 import되지 않음. 파일 삭제로 dead code 정리. (AdminSidebar는 별도 컴포넌트로 admin shell에서 계속 사용 중 — 영향 없음) Co-Authored-By: Claude Opus 4.7 (1M context) --- app/components/Sidebar.tsx | 262 ------------------------------------- 1 file changed, 262 deletions(-) delete mode 100644 app/components/Sidebar.tsx diff --git a/app/components/Sidebar.tsx b/app/components/Sidebar.tsx deleted file mode 100644 index 0b6a07d..0000000 --- a/app/components/Sidebar.tsx +++ /dev/null @@ -1,262 +0,0 @@ -'use client'; - -import Link from 'next/link'; -import { usePathname, useRouter } from 'next/navigation'; -import { useEffect, useState } from 'react'; -import { createClient } from '@/lib/supabase/client'; - -/* ── 3구역 네비게이션 구조 ─────────────────────────────────── */ - -interface NavItem { - href: string; - label: string; - badge?: string; - icon: React.ReactNode; -} - -interface NavGroup { - title: string; - items: NavItem[]; -} - -const navGroups: NavGroup[] = [ - { - title: 'AI 상품', - items: [ - { - href: '/services/music', - label: 'AI 음악 마스터', - badge: 'NEW', - icon: ( - - - - ), - }, - { - href: '/services/blog', - label: '블로그 자동화 팩', - icon: ( - - - - ), - }, - ], - }, - { - title: '무료 도구', - items: [ - { - href: '/saju', - label: 'AI 사주 분석', - badge: '무료', - icon: ( - - - - ), - }, - ], - }, -]; - -/* ── 배지 색상 ─────────────────────────────────────────────── */ -function badgeStyle(badge: string) { - switch (badge) { - case 'HOT': - return 'bg-rose-500/15 text-rose-400'; - case '구독': - return 'bg-violet-500/15 text-violet-400'; - case '무료': - return 'bg-sky-500/15 text-sky-400'; - case 'DEMO': - return 'bg-amber-500/15 text-amber-400'; - default: - return 'bg-emerald-500/15 text-emerald-400'; - } -} - -/* ── 컴포넌트 ──────────────────────────────────────────────── */ - -interface SidebarProps { - isOpen: boolean; - onClose: () => void; -} - -export default function Sidebar({ isOpen, onClose }: SidebarProps) { - const pathname = usePathname(); - const router = useRouter(); - const [userEmail, setUserEmail] = useState(null); - const supabase = createClient(); - - useEffect(() => { - supabase.auth.getUser().then(({ data }) => { - setUserEmail(data.user?.email ?? null); - }); - - const { data: { subscription } } = supabase.auth.onAuthStateChange((_, session) => { - setUserEmail(session?.user?.email ?? null); - }); - - return () => subscription.unsubscribe(); - }, []); - - const handleLogout = async () => { - await supabase.auth.signOut(); - router.push('/'); - router.refresh(); - onClose(); - }; - - return ( - <> - {/* Mobile overlay */} - {isOpen && ( -
- )} - - {/* Sidebar */} - - - ); -}