Compare commits

..

5 Commits

Author SHA1 Message Date
2e19d5fdeb Update .env 2024-06-08 20:44:20 -04:00
63f31e0f4c Update server.ts 2024-06-08 20:08:25 -04:00
f75d889ee8 Delete page.tsx 2024-06-08 19:51:44 -04:00
8877362484 Update server.ts 2024-06-08 19:50:08 -04:00
082c161959 Update page.tsx 2024-06-08 19:45:31 -04:00
3 changed files with 2 additions and 62 deletions

1
.env
View File

@ -1,3 +1,2 @@
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU

View File

@ -1,59 +0,0 @@
"use client";
import { createClient } from "@/utils/supabase/client";
import React, { useState, useEffect } from 'react';
function PageComponent() {
const supabase = createClient();
const [users, setUsers] = useState<any[]>([]);
const getData = async () => {
try {
const response = await fetch('/api/admin/users');
if (response.ok) {
const data = await response.json();
console.log(data)
setUsers(data.users);
} else {
console.error('failed to fetch tiers');
}
} catch (error) {
console.error('Error fetching users:', error);
}
}
useEffect(() => {
getData();
}, []);
return (
<div className="w-full text-white flex justify-center items-center animate-in">
<div className="w-2/3 rounded-md bg-primary p-12 mt-32 shadow-lg opacity-90 backdrop-blur-lg">
<div className="w-2/5 rounded-md bg-secondary-dark p-12 shadow-lg opacity-90 backdrop-blur-lg">
<input type="text" className="mb-4 mr-2 rounded-md bg-primary p-2 w-full text-white" placeholder="Search all users by email" />
<div className="w-full h-96 overflow-y-scroll no-scrollbar">
<table className="w-full">
<thead>
<tr>
<th className="px-4 py-2"></th>
<th className="px-4 py-2"></th>
</tr>
</thead>
<tbody>
{users.map((data, index) => (
<tr key={index} className="rounded hover:bg-primary bg-primary-light shadow-lg">
<td className="px-4 py-2">{data.email}</td>
<td className="px-4 py-2"><button className="p-2 rounded w-full hover:bg-primary-light bg-primary">View</button></td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
</div>
);
}
export default PageComponent;

View File

@ -148,7 +148,7 @@ function PageComponent() {
title={galleryName}
subscription={tier}
tags={tags}
subscriptionColor={subscriptionColorç}
subscriptionColor={subscriptionColor}
showNsfw={false}
nsfw={nsfw}
></GalleryThumbnail>