addPage for gmpl
This commit is contained in:
+20
-2
@@ -1,13 +1,19 @@
|
||||
'use client'
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useContext } from 'react';
|
||||
import { Box, Button, Output } from "./modules";
|
||||
import { calculate_click, downloadLP, downloadMPS } from "./scripts";
|
||||
import text from "./lang";
|
||||
import { spec } from 'node:test/reporters';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { LanguageContext } from './context/LanguageContext';
|
||||
|
||||
export default function Home() {
|
||||
const [language, setLanguage] = useState('eng');
|
||||
const { language, setLanguage } = useContext(LanguageContext);
|
||||
const [maxminOption, setMaxminOption] = useState('maximize');
|
||||
const [model] = useState('spec');
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
const tr_hTitle = text(language, 'header_title');
|
||||
const tr_hSubtitle = text(language, 'header_subtitle');
|
||||
@@ -30,6 +36,14 @@ export default function Home() {
|
||||
setLanguage(event.target.value);
|
||||
};
|
||||
|
||||
const changeModel = (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
const selectedModel = event.target.value;
|
||||
|
||||
if (selectedModel === 'gen') {
|
||||
router.push('./glp');
|
||||
}
|
||||
};
|
||||
|
||||
const handleMaxMinChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
setMaxminOption(event.target.value);
|
||||
};
|
||||
@@ -49,6 +63,10 @@ export default function Home() {
|
||||
<option value="ger">Deutsch</option>
|
||||
<option value="eng">English</option>
|
||||
</select>
|
||||
<select id="language_current" value={model} onChange={changeModel} className="dropdown-custom">
|
||||
<option value="gen">General Problems</option>
|
||||
<option value="spec">Specific Problems</option>
|
||||
</select>
|
||||
</main>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user