diff --git a/app/page.tsx b/app/page.tsx index dce91ae..812c5dd 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,7 +1,101 @@ -import Image from "next/image"; +"use client" + +import { useState } from 'react'; +import { useRouter } from 'next/navigation'; export default function Home() { + const [icalLink, setIcalLink] = useState(''); + const [days, setDays] = useState(7) // standart: 7 days + + const router = useRouter(); + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); // website won't reload + + if (!icalLink) { + return; + } + + //const encodedLink = encodeURIComponent(icalLink.trim()); + + router.push(`/evaluation?days=${days}&ical-link=${icalLink}`); + }; + return ( -

hi

+
+
+
+
+ + setIcalLink(e.target.value)} + placeholder="https://example.com/calendar.ics" + required + style={{ + padding: '0.5rem', + borderRadius: '4px', + border: '1px solid #ccc', + fontSize: '1rem', + }} + /> +
+ +
+ + setDays(Number(e.target.value) || '')} + placeholder="7" + required + style={{ + padding: '0.5rem', + borderRadius: '4px', + border: '1px solid #ccc', + fontSize: '1rem', + }} + /> +
+ + +
+
+
); }