diff --git a/apps/portal/src/pages/questions/landing.tsx b/apps/portal/src/components/questions/LandingComponent.tsx
similarity index 65%
rename from apps/portal/src/pages/questions/landing.tsx
rename to apps/portal/src/components/questions/LandingComponent.tsx
index 6f80619c..97a3e647 100644
--- a/apps/portal/src/pages/questions/landing.tsx
+++ b/apps/portal/src/components/questions/LandingComponent.tsx
@@ -1,19 +1,37 @@
-import { useForm } from 'react-hook-form';
+import { useState } from 'react';
import { Button, Select } from '@tih/ui';
import NavBar from '~/components/questions/NavBar';
export type LandingQueryData = {
- date: string;
+ company: string;
location: string;
questionType: string;
};
-export default function LandingPage() {
- const { register, handleSubmit } = useForm();
- const onSubmit = (data: LandingQueryData) => {
- // eslint-disable-next-line no-console
- console.log(data);
+export type LandingComponentProps = {
+ handleLandingQuery: (data: LandingQueryData) => void;
+};
+
+export default function LandingComponent({
+ handleLandingQuery,
+}: LandingComponentProps) {
+ const [landingQueryData, setLandingQueryData] = useState({
+ company: 'google',
+ location: 'singapore',
+ questionType: 'coding',
+ });
+
+ const handleChangeCompany = (company: string) => {
+ setLandingQueryData((prev) => ({ ...prev, company }));
+ };
+
+ const handleChangeLocation = (location: string) => {
+ setLandingQueryData((prev) => ({ ...prev, location }));
+ };
+
+ const handleChangeType = (questionType: string) => {
+ setLandingQueryData((prev) => ({ ...prev, questionType }));
};
return (
@@ -29,13 +47,10 @@ export default function LandingPage() {
Get to know the latest SWE interview questions asked by top companies
-