diff --git a/.gitignore b/.gitignore index 40b878d..0f3eb49 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,29 @@ -node_modules/ \ No newline at end of file +# Create or edit .gitignore +echo "# Next.js build output +.next/ +.next/** +.next/dev/lock + +# Dependencies +node_modules/ + +# Environment files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Debug logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.vscode/ +.idea/ +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw?" >> .gitignore \ No newline at end of file diff --git a/app/admin/dashboard/page.tsx b/app/admin/dashboard/page.tsx new file mode 100644 index 0000000..e12c518 --- /dev/null +++ b/app/admin/dashboard/page.tsx @@ -0,0 +1,66 @@ +'use client'; + +import { useAuth } from '@/contexts/AuthContext'; +import Link from 'next/link'; +import { UsersIcon, CubeIcon, TagIcon } from '@heroicons/react/24/outline'; + +export default function Dashboard() { + const { user, logout } = useAuth(); + + return ( +
+ مشاهده و مدیریت کاربران، اشتراکها و تراکنشها +
++ ایجاد و مدیریت پکیجهای نرمافزار +
++ ایجاد و مدیریت محصولات و اشتراکها +
++ Meditation App Admin Panel +
+{error}
+{success}
+{error}
+{success}
+{error}
+{success}
+هیچ پکیجی یافت نشد. ابتدا یک پکیج ایجاد کنید.
++ {product.title || 'محصول'} +
++ قیمت: {formatPrice(product.price)} تومان +
++ نوع: {getProductTypeLabel(product.type)} +
++ برای افزودن اشتراک به کاربر، ابتدا یک کاربر جستجو کنید +
+هیچ پکیجی یافت نشد
++ {pkg.title || 'بدون عنوان'} +
++ {pkg.name || 'بدون نام'} +
++ شناسه: {pkg.uuid?.substring(0, 8)}... +
++ تلاشها: {pkg.tries || 0} +
++ آخرین بهروزرسانی: {formatDate(pkg.updated_at)} +
+هیچ محصولی برای این پکیج یافت نشد
++ {product.title || 'بدون عنوان'} +
+ + {getProductTypeLabel(product.type)} + ++ قیمت: {formatPrice(product.price)} تومان +
+ {product.descriptions && product.descriptions.length > 0 && ( +ویژگیها:
++ {product.title || 'محصول'} +
+ {subscriptionCount > 1 && ( + + {subscriptionCount} اشتراک + + )} +
+
+ قیمت: {formatPrice(product.price)} تومان +
++ نوع: {getProductTypeLabel(product.type)} +
+ {product.pivot?.expire_at && ( ++ تاریخ انقضا: {formatDate(product.pivot.expire_at)} +
+ )} +