From 9fd79a2d4ec1d17df353ba03f1897085aea8d31f Mon Sep 17 00:00:00 2001 From: nfel Date: Tue, 30 Dec 2025 02:07:26 +0330 Subject: [PATCH] main: fix build issue Signed-off-by: nfel --- app/api/payment/initiate/route.ts | 2 +- app/api/payment/verify/route.ts | 2 +- components/AddAlbumModal.tsx | 59 +++++++++++++++++++++++++++++++ components/EditAlbumModal.tsx | 59 +++++++++++++++++++++++++++++++ lib/data.ts | 5 ++- 5 files changed, 124 insertions(+), 3 deletions(-) diff --git a/app/api/payment/initiate/route.ts b/app/api/payment/initiate/route.ts index 1d63a2c..3666f41 100644 --- a/app/api/payment/initiate/route.ts +++ b/app/api/payment/initiate/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from 'next/server'; -import { ZarinPal } from 'zarinpal-node-sdk'; +import ZarinPal from 'zarinpal-node-sdk'; import { getDatabase } from '@/lib/db'; const zarinpal = new ZarinPal({ diff --git a/app/api/payment/verify/route.ts b/app/api/payment/verify/route.ts index d9deb3a..4b43190 100644 --- a/app/api/payment/verify/route.ts +++ b/app/api/payment/verify/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from 'next/server'; -import { ZarinPal } from 'zarinpal-node-sdk'; +import ZarinPal from 'zarinpal-node-sdk'; import { getDatabase } from '@/lib/db'; const zarinpal = new ZarinPal({ diff --git a/components/AddAlbumModal.tsx b/components/AddAlbumModal.tsx index f6df543..0260562 100644 --- a/components/AddAlbumModal.tsx +++ b/components/AddAlbumModal.tsx @@ -22,6 +22,9 @@ export default function AddAlbumModal({ show, onClose, onAdd }: AddAlbumModalPro const [isUploading, setIsUploading] = useState(false); const [songs, setSongs] = useState([{ id: '', title: '', duration: '', previewUrl: '', fullUrl: '' }]); const [error, setError] = useState(''); + const [tag, setTag] = useState<'Album' | 'EP' | 'Demo' | 'Deluxe' | 'Single'>('Album'); + const [format, setFormat] = useState<'mp3' | 'm4a' | 'flac' | 'wav'>('mp3'); + const [bitrate, setBitrate] = useState('320kbps'); const handleAddSong = () => { setSongs([...songs, { id: '', title: '', duration: '', previewUrl: '', fullUrl: '' }]); @@ -134,6 +137,9 @@ export default function AddAlbumModal({ show, onClose, onAdd }: AddAlbumModalPro description, price: priceNum, songs: albumSongs, + tag, + format, + bitrate, }; onAdd(newAlbum); @@ -150,6 +156,9 @@ export default function AddAlbumModal({ show, onClose, onAdd }: AddAlbumModalPro setCoverImageFile(null); setSongs([{ id: '', title: '', duration: '', previewUrl: '', fullUrl: '' }]); setError(''); + setTag('Album'); + setFormat('mp3'); + setBitrate('320kbps'); onClose(); }; @@ -309,6 +318,56 @@ export default function AddAlbumModal({ show, onClose, onAdd }: AddAlbumModalPro /> + {/* Tag, Format, and Bitrate */} +
+
+ + +
+
+ + +
+
+ + setBitrate(e.target.value)} + placeholder="320kbps" + className="w-full px-4 py-3 bg-white/5 border border-white/10 rounded-lg focus:border-accent-cyan focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 text-white placeholder-gray-500" + required + /> +
+
+ {/* Songs */}
diff --git a/components/EditAlbumModal.tsx b/components/EditAlbumModal.tsx index f1d8183..944512d 100644 --- a/components/EditAlbumModal.tsx +++ b/components/EditAlbumModal.tsx @@ -23,6 +23,9 @@ export default function EditAlbumModal({ show, album, onClose, onUpdate }: EditA const [isUploading, setIsUploading] = useState(false); const [songs, setSongs] = useState([{ id: '', title: '', duration: '', previewUrl: '', fullUrl: '' }]); const [error, setError] = useState(''); + const [tag, setTag] = useState<'Album' | 'EP' | 'Demo' | 'Deluxe' | 'Single'>('Album'); + const [format, setFormat] = useState<'mp3' | 'm4a' | 'flac' | 'wav'>('mp3'); + const [bitrate, setBitrate] = useState('320kbps'); // Populate form when album changes useEffect(() => { @@ -34,6 +37,9 @@ export default function EditAlbumModal({ show, album, onClose, onUpdate }: EditA setPrice(album.price.toString()); setCoverImage(album.coverImage || ''); setSongs(album.songs.map((song) => ({ ...song }))); + setTag(album.tag); + setFormat(album.format); + setBitrate(album.bitrate); } }, [album]); @@ -149,6 +155,9 @@ export default function EditAlbumModal({ show, album, onClose, onUpdate }: EditA description, price: priceNum, songs: albumSongs, + tag, + format, + bitrate, }; onUpdate(album.id, updatedAlbum); @@ -318,6 +327,56 @@ export default function EditAlbumModal({ show, album, onClose, onUpdate }: EditA />
+ {/* Tag, Format, and Bitrate */} +
+
+ + +
+
+ + +
+
+ + setBitrate(e.target.value)} + placeholder="320kbps" + className="w-full px-4 py-3 bg-white/5 border border-white/10 rounded-lg focus:border-accent-orange focus:outline-none focus:ring-2 focus:ring-accent-orange/50 text-white placeholder-gray-500" + required + /> +
+
+ {/* Songs */}
diff --git a/lib/data.ts b/lib/data.ts index a97095c..6717479 100644 --- a/lib/data.ts +++ b/lib/data.ts @@ -163,7 +163,10 @@ export const albums: Album[] = [ coverImage: "/albums/showbiz.jpg", year: 1999, genre: "Alternative Rock / Progressive Rock", - price: 11.99, + price: 250000, + tag: "Album", + format: "mp3", + bitrate: "320kbps", description: "A powerful debut album blending alternative rock with progressive elements. Features raw energy, soaring vocals, and guitar-driven anthems that established a unique sound in the late 90s rock scene.", songs: [ {