-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a5c8fa
commit a668ee3
Showing
40 changed files
with
1,341 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"use client"; | ||
|
||
function AnalyticsDashboard() { | ||
return <div>AnalyticsDashboard</div>; | ||
} | ||
|
||
export default AnalyticsDashboard; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,41 @@ | ||
"use client"; | ||
|
||
import { TrendingUp } from "lucide-react"; | ||
|
||
import { | ||
AreaChartComponent, | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardFooter, | ||
CardHeader, | ||
CardTitle, | ||
} from "@referrer/ui"; | ||
|
||
function RevenueDashboard() { | ||
return <div>RevenueDashboard</div>; | ||
return ( | ||
<Card> | ||
<CardHeader> | ||
<CardTitle>Area Chart - Gradient</CardTitle> | ||
<CardDescription>Showing total visitors for the last 6 months</CardDescription> | ||
</CardHeader> | ||
<CardContent> | ||
<AreaChartComponent /> | ||
</CardContent> | ||
<CardFooter> | ||
<div className="flex w-full items-start gap-2 text-sm"> | ||
<div className="grid gap-2"> | ||
<div className="flex items-center gap-2 font-medium leading-none"> | ||
Trending up by 5.2% this month <TrendingUp className="h-4 w-4" /> | ||
</div> | ||
<div className="text-muted-foreground flex items-center gap-2 leading-none"> | ||
January - June 2024 | ||
</div> | ||
</div> | ||
</div> | ||
</CardFooter> | ||
</Card> | ||
); | ||
} | ||
|
||
export default RevenueDashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { NextRequest, NextResponse } from "next/server"; | ||
|
||
import prisma from "@referrer/prisma"; | ||
|
||
export async function GET(request: NextRequest, { params }: { params: { postId: string } }) { | ||
const { postId } = params; | ||
|
||
// const { user } = await getServerAuthSession(); | ||
|
||
// const cachedAllRequests = await redis.get(`USER:REQUESTS:${userId}`); | ||
// if (cachedAllRequests) return JSON.parse(cachedAllRequests); | ||
const data = await prisma.posts.findUnique({ | ||
where: { | ||
id: postId, | ||
}, | ||
select: { | ||
applied: { | ||
select: { | ||
id: true, | ||
applyInfo: true, | ||
appliedAt: true, | ||
reply: true, | ||
status: true, | ||
visibility: true, | ||
user: { | ||
select: { | ||
name: true, | ||
userName: true, | ||
image: true, | ||
email: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
// await redis.set(`USER:REQUESTS:${userId}`, JSON.stringify(requests), "EX", cacheTime); | ||
|
||
return NextResponse.json( | ||
{ data: data }, | ||
{ | ||
status: 200, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { NextRequest, NextResponse } from "next/server"; | ||
|
||
import prisma from "@referrer/prisma"; | ||
|
||
export async function GET(request: NextRequest) { | ||
const searchParams = request.nextUrl.searchParams; | ||
const id = searchParams.get("userId"); | ||
|
||
// const { user } = await getServerAuthSession(); | ||
|
||
// const cachedAllRequests = await redis.get(`USER:REQUESTS:${userId}`); | ||
// if (cachedAllRequests) return JSON.parse(cachedAllRequests); | ||
const data = await prisma.user.findUnique({ | ||
where: { | ||
id: id, | ||
}, | ||
select: { | ||
posts: { | ||
select: { | ||
id: true, | ||
description: true, | ||
stars: true, | ||
createdAt: true, | ||
totalApplied: true, | ||
acceptLimit: true, | ||
expiresAt: true, | ||
}, | ||
}, | ||
}, | ||
}); | ||
// await redis.set(`USER:REQUESTS:${userId}`, JSON.stringify(requests), "EX", cacheTime); | ||
|
||
return NextResponse.json( | ||
{ data: data }, | ||
{ | ||
status: 200, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ImageResponse } from "next/og"; | ||
|
||
// import { Icons } from "@/components/icons/icons"; | ||
|
||
// import { siteConfig } from "@/config"; | ||
|
||
export async function GET(request: Request) { | ||
try { | ||
const { searchParams } = new URL(request.url); | ||
|
||
// ?title=<title> | ||
|
||
const title = searchParams.has("title") && searchParams.get("title")?.slice(0, 100); | ||
const image = searchParams.get("image") || ""; | ||
|
||
return new ImageResponse( | ||
( | ||
<div | ||
style={{ | ||
backgroundColor: "hsl(var(--foreground))", | ||
height: "100%", | ||
width: "100%", | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
fontSize: 32, | ||
fontWeight: 600, | ||
}}> | ||
<svg width="75" viewBox="0 0 75 65" fill="#000" style={{ margin: "0 75px" }}> | ||
<path d="M37.59.25l36.95 64H.64l36.95-64z"></path> | ||
</svg> | ||
<div style={{ marginTop: 40, fontFamily: "hsl(var(--font-heading))" }}>Hello, World</div> | ||
</div> | ||
) | ||
); | ||
} catch (e: any) { | ||
console.log(`${e.message}`); | ||
return new Response(`Failed to generate the image`, { | ||
status: 500, | ||
}); | ||
} | ||
} |
Oops, something went wrong.