Skip to content

Instantly share code, notes, and snippets.

View Kevin-free's full-sized avatar
公众号:Kevin的学堂

kevintao1024 Kevin-free

公众号:Kevin的学堂
View GitHub Profile
import { NextResponse } from 'next/server';
import { headers } from 'next/headers';
import Stripe from 'stripe';
import connectMongo from '@/libs/mongoose';
import User from '@/models/User';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET;
export async function POST(req) {
import React, { useContext, useCallback } from 'react';
import { Sun, Moon } from 'lucide-react';
import { ThemeContext } from '~/hooks';
const Theme = ({ theme, onChange }: { theme: string; onChange: (value: string) => void }) => {
const themeIcons = {
system: <Sun />,
dark: <Moon color="white" />,
light: <Sun />,
};
import React, { useState, useEffect, useRef } from 'react';
import { useNavigate } from 'react-router-dom';
const ScrollingTextRows: React.FC = () => {
const [hoveredRow, setHoveredRow] = useState<number | null>(null);
const scrollRefs = useRef<HTMLDivElement[]>([]);
const navigate = useNavigate();
useEffect(() => {
const scroll = (direction: number, index: number) => {