This commit is contained in:
2026-11-02 20:31:15 +02:00
parent 8ddfa93f45
commit 1da273f1f3
131 changed files with 14802 additions and 526 deletions
+24 -5
View File
@@ -1,7 +1,6 @@
import { Link } from '@inertiajs/react';
import { Link, router } from '@inertiajs/react';
import { ArrowRight, Search } from 'lucide-react';
import { useEffect, useState } from 'react';
import type { FormEvent } from 'react';
import type { HomeResponse } from '@/lib/portal-api';
const slides = [
@@ -127,7 +126,6 @@ function HeroAnimatedCopy({
type PortalHeroProps = {
query: string;
setQuery: (value: string) => void;
onSearch: (event: FormEvent<HTMLFormElement>) => void;
stats?: HomeResponse['data']['stats'];
};
@@ -135,7 +133,6 @@ type PortalHeroProps = {
export default function PortalHero({
query,
setQuery,
onSearch,
stats,
}: PortalHeroProps) {
const [currentSlide, setCurrentSlide] = useState(0);
@@ -229,7 +226,20 @@ export default function PortalHero({
</p>
<form
onSubmit={onSearch}
action="/oportunidades"
method="get"
onSubmit={(event) => {
event.preventDefault();
const value = new FormData(event.currentTarget).get(
'q',
);
router.get('/oportunidades', {
q:
typeof value === 'string'
? value.trim()
: query.trim(),
});
}}
role="search"
aria-label="Pesquisar oportunidades"
className="mt-7 w-full max-w-4xl"
@@ -245,6 +255,8 @@ export default function PortalHero({
id="portal-opportunity-search"
type="search"
name="q"
maxLength={120}
aria-describedby="portal-opportunity-search-help"
value={query}
onChange={(event) => setQuery(event.target.value)}
placeholder="Ex.: agronegócio, Nampula, energia..."
@@ -258,6 +270,13 @@ export default function PortalHero({
Pesquisar
</button>
</div>
<p
id="portal-opportunity-search-help"
className="mt-2 text-left text-sm text-white/90"
>
Combine palavras-chave, sector e localização. Ex.:
plantio de algodão ou agronegócio Nampula.
</p>
</form>
<div className="mt-4 flex flex-wrap items-center justify-center gap-2">