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
export default function Home() { | |
let searchParams = useSearchParams(); | |
let [search, setSearch] = useState(searchParams.get('search') ?? ''); | |
let { data, isPlaceholderData } = useQuery({ | |
queryKey: ['people', search], | |
queryFn: async () => { | |
let res = await fetch(`/api/people?search=${search}`); | |
let data = await res.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
import { NextRequest, NextResponse } from 'next/server'; | |
import { words } from './words'; | |
export const dynamic = 'force-dynamic'; | |
const getRandomWord = () => { | |
const randomIndex = Math.floor(Math.random() * words.length); | |
return words[randomIndex]; | |
}; |
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
import { headers } from "next/headers"; | |
export function geoLocation() { | |
const headersList = headers(); | |
return { | |
ip: headersList.get("x-real-ip"), | |
country: headersList.get("x-vercel-ip-country"), | |
city: headersList.get("x-vercel-ip-city"), | |
}; | |
} |
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
export const copyToClipboard = async (dataUrl: string) => { | |
try { | |
// Convert the Data URL to a Blob | |
const response = await fetch(dataUrl); | |
const blob = await response.blob(); | |
// Check if the image is in a supported format, convert if necessary | |
let pngBlob = blob; | |
if (blob.type !== 'image/png') { |
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
export const updateDocumentsWithVinyls = async () => { | |
try { | |
const collectionRef = collection(db, 'frames'); | |
const querySnapshot = await getDocs(collectionRef); | |
for (const docSnapshot of querySnapshot.docs) { | |
const documentData = docSnapshot.data(); | |
// Check if the document has a 'keywords' field and it's a comma-separated string |
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
// components/TopLoadingIndicator.js | |
import { useEffect, useState } from 'react'; | |
import { useRouter } from 'next/router'; | |
const TopLoadingIndicator = () => { | |
const router = useRouter(); | |
const [loading, setLoading] = useState(false); | |
useEffect(() => { | |
const handleStart = () => { |
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
import * as React from "react" | |
export function useDebounce( | |
value | |
delay | |
callback | |
) { | |
const [debouncedValue, setDebouncedValue] = React.useState(value) | |
React.useEffect(() => { |
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
"use client"; | |
import { useAuth } from "@clerk/nextjs"; | |
import * as Sentry from "@sentry/nextjs"; | |
import { useEffect, useState } from "react"; | |
function createWidget() { | |
return Sentry.getFeedback()?.createWidget(); | |
} |
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
'use client' | |
import React, { useState, useEffect } from "react"; | |
import { motion, useAnimation, useMotionValue, useTransform } from "framer-motion"; | |
import Image from "next/image"; | |
import { RightArrow } from "../globals/Icons"; | |
const images = []; | |
for (let i = 1; i <= 14; i++) { | |
images.push(import(`@/assets/quick-carousel/${i}.webp`).then(module => module.default)); | |
} |
NewerOlder