-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpage.js
More file actions
51 lines (41 loc) · 1.7 KB
/
page.js
File metadata and controls
51 lines (41 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"use client";
import React, { useEffect, useState, useRef } from 'react';
import dynamic from 'next/dynamic';
const DynamicVideoPane = dynamic(() => import('../components/UserVideoPane').then((module) => module.default), {
loading: () => <p>Loading...</p>,
ssr: false, // Disable server-side rendering for this component
});
const PitchPage = () => {
const [isComponentLoaded, setIsComponentLoaded] = useState(false);
const taskRef = useRef("");
useEffect(() => {
const url = new URL(window.location.href);
const searchParams = new URLSearchParams(url.search);
let task = searchParams.get('task');
// console.log(url);
// console.log(searchParams);
// console.log('task:', task);
if (task == null || task == "") {
task = "Pitch a startup to empower users' teaching skills by using AI to simulate a learner.";
} else {
taskRef.current = task;
}
}, []);
const taskPrefix = "You are a venture capitalist looking to invest in new firms. A team has come to you to: ";
const taskSuffix = ". You should ask sharp questions about their market, their vision, their growth plan, and"
+ " other aspects of their idea which would be relevant in predicting future commercial success.";
useEffect(() => {
setIsComponentLoaded(true);
}, []);
return (
<>
{isComponentLoaded &&
<div className="w-screen h-full bg-gradient-to-b from-jetBlack-400 to-jetBlack-600">
<h1 className="text-center text-platinum-500 text-3xl font-bold p-4 pt-16">Task: {taskRef.current}</h1>
<DynamicVideoPane taskPrefix={taskPrefix} task={taskRef.current} taskSuffix={taskSuffix} type="pitch" />
</div>
}
</>
);
};
export default PitchPage;