diff --git a/app/admin/components/AdminSidebar.tsx b/app/admin/components/AdminSidebar.tsx index 62e3e03..38c50fd 100644 --- a/app/admin/components/AdminSidebar.tsx +++ b/app/admin/components/AdminSidebar.tsx @@ -46,6 +46,16 @@ const NAV_ITEMS = [ ), }, + { + href: '/admin/products', + label: '제품 관리', + icon: ( + + ), + }, { href: '/admin/contacts', label: '문의 내역', diff --git a/app/admin/packs/page.tsx b/app/admin/packs/page.tsx index fa98663..85bce05 100644 --- a/app/admin/packs/page.tsx +++ b/app/admin/packs/page.tsx @@ -1,6 +1,7 @@ 'use client'; import { useEffect, useState } from 'react'; +import Link from 'next/link'; type PackTier = 'starter' | 'pro' | 'master'; @@ -155,6 +156,10 @@ export default function AdminPacksPage() {
NAS 자료 업로드 + 다운로드 활성화. 최대 5GB / 4시간 만료 공유 링크.
++ 음악 팩 레거시 관리 화면입니다. 신규 제품 파일은{' '} + 제품 관리에서 배정하세요. +
{/* 업로드 폼 */} diff --git a/app/admin/products/page.tsx b/app/admin/products/page.tsx new file mode 100644 index 0000000..034e0bf --- /dev/null +++ b/app/admin/products/page.tsx @@ -0,0 +1,560 @@ +'use client'; + +import { useEffect, useState } from 'react'; + +interface Product { + id: string; + name: string; + description: string | null; + description_long: string | null; + price: number; + features: string[] | null; + is_listed: boolean; + is_active: boolean; + sort_order: number; +} + +interface PackFile { + id: string; + product_id: string | null; + label: string; + filename: string; + size_bytes: number; +} + +function formatSize(bytes: number): string { + if (bytes < 1024) return `${bytes} B`; + if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; + if (bytes < 1024 * 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(1)} MB`; + return `${(bytes / 1024 / 1024 / 1024).toFixed(2)} GB`; +} + +const EMPTY_FORM = { + id: '', + name: '', + price: 0, + description: '', + description_long: '', + featuresText: '', + is_listed: false, + sort_order: 0, +}; + +export default function AdminProductsPage() { + const [products, setProducts] = useState+ 완성 소프트웨어 제품 등록·카탈로그 노출·다운로드 파일 배정. +
+불러오는 중...
+ ) : loadError ? ( +{loadError}
+ ) : products.length === 0 ? ( +등록된 제품이 없습니다. [+ 새 제품]으로 등록하세요.
+ ) : ( +| 제품명 | +가격 | +노출 | +순서 | +관리 | +
|---|---|---|---|---|
| + {p.name} + {p.id} + | +₩{p.price.toLocaleString()} | ++ + | +{p.sort_order} | ++ + + | +
배정된 파일이 없습니다.
+ ) : ( +배정 가능한 다른 파일이 없습니다.
+ ) : ( +