feat: add subdomain management, comprehensive QR code creation/redirection, and dashboard UI with white-label support.
This commit is contained in:
@@ -44,6 +44,7 @@ export default function DashboardPage() {
|
||||
uniqueScans: 0,
|
||||
});
|
||||
const [analyticsData, setAnalyticsData] = useState<any>(null);
|
||||
const [userSubdomain, setUserSubdomain] = useState<string | null>(null);
|
||||
|
||||
const mockQRCodes = [
|
||||
{
|
||||
@@ -279,6 +280,13 @@ export default function DashboardPage() {
|
||||
const analytics = await analyticsResponse.json();
|
||||
setAnalyticsData(analytics);
|
||||
}
|
||||
|
||||
// Fetch user subdomain for white label display
|
||||
const subdomainResponse = await fetch('/api/user/subdomain');
|
||||
if (subdomainResponse.ok) {
|
||||
const subdomainData = await subdomainResponse.json();
|
||||
setUserSubdomain(subdomainData.subdomain || null);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching data:', error);
|
||||
setQrCodes([]);
|
||||
@@ -449,10 +457,11 @@ export default function DashboardPage() {
|
||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{qrCodes.map((qr) => (
|
||||
<QRCodeCard
|
||||
key={qr.id}
|
||||
key={`${qr.id}-${userSubdomain || 'default'}`}
|
||||
qr={qr}
|
||||
onEdit={handleEdit}
|
||||
onDelete={handleDelete}
|
||||
userSubdomain={userSubdomain}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user