This file contains hidden or 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 from "react"; | |
| import ReactPlayer from "react-player"; | |
| const VideoPlayer = () => { | |
| let videosrc = "/videos/next.mp4"; | |
| return ( | |
| <div> | |
| <h1>my custome player</h1> |
This file contains hidden or 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 React from "react"; | |
| import VideoPlayer from "@/components/VideoPlayer"; | |
| const Home = () => { | |
| return ( | |
| <div className="w-screen h-screen flex flex-col gap-4 text-lg font-semibold justify-center items-center "> | |
| <h1>Video Player App</h1> | |
| <VideoPlayer /> | |
| </div> | |
| ); |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "target": "ES2020", | |
| "module": "CommonJS", | |
| "strict": true, | |
| "outDir": "./dist", | |
| "rootDir": "./src" | |
| }, | |
| "include": ["src/**/*.ts"], | |
| "exclude": ["node_modules"] |
This file contains hidden or 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 { toast } from 'react-hot-toast'; | |
| function MyComponent() { | |
| const handleButtonClick = () => { | |
| toast.success('You did it!'); // Displays a success message | |
| }; | |
| return ( | |
| <div> | |
| <button onClick={handleButtonClick}>Show Success Toast</button> |
This file contains hidden or 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 "./globals.css"; | |
| import { Inter } from "next/font/google"; | |
| import { Toaster } from "react-hot-toast"; | |
| const inter = Inter({ subsets: ["latin"] }); | |
| export const metadata = { | |
| title: "Create Next App", | |
| description: "Generated by create next app", | |
| }; |
This file contains hidden or 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 React from 'react'; | |
| import useCounter from './useCounter'; | |
| function Counter() { | |
| const { count, increment, decrement } = useCounter(); | |
| return ( | |
| <div> | |
| <p>Count: {count}</p> | |
| <button onClick={increment}>Increment</button> |
This file contains hidden or 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 { useState } from 'react'; | |
| function useCounter(initialValue = 0) { | |
| const [count, setCount] = useState(initialValue); | |
| const increment = () => { | |
| setCount(count + 1); | |
| }; | |
| const decrement = () => { |
This file contains hidden or 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 User from "@/models/userModel"; | |
| import { NextRequest, NextResponse } from "next/server"; | |
| import { connect } from "@/dbConfig/dbConfig"; | |
| import { getDataFromToken } from "@/helpers/jwt"; | |
| connect(); | |
| export async function GET(request: NextRequest) { | |
| try { | |
| const userId: any = await getDataFromToken(request); |
This file contains hidden or 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 React, { useEffect, useState } from "react"; | |
| import { useSelector } from "react-redux"; | |
| import { setUserData } from "@/redux/features/userSlice"; | |
| const UserInitial = () => { | |
| const userData = useSelector(setUserData); | |
| const [user, setUser] = useState(null); | |
| useEffect(() => { | |
| setUser(userData.payload.user.userData.username); | |
| }, []); | |
| return ( |
This file contains hidden or 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 { useDispatch, useSelector } from "react-redux"; | |
| import { setUserData, setLoading, setError } from "@/redux/features/userSlice"; | |
| import axios from "axios"; | |
| import Link from "next/link"; | |
| import { TbPencilMinus } from "react-icons/tb"; | |
| import SearchBar from "../searchBar/page"; | |
| import Image from "next/image"; |