feat: Add i18n support to company registration page
This commit is contained in:
parent
f81a97a224
commit
2c27836245
4 changed files with 349 additions and 131 deletions
|
|
@ -5,13 +5,6 @@ import { useRouter } from "next/navigation";
|
|||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
|
|
@ -31,50 +24,51 @@ import {
|
|||
EyeOff,
|
||||
Phone,
|
||||
MapPin,
|
||||
Users,
|
||||
Globe,
|
||||
FileText,
|
||||
ArrowLeft,
|
||||
} from "lucide-react";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { motion } from "framer-motion";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { z } from "zod";
|
||||
|
||||
const companySchema = z.object({
|
||||
companyName: z.string().min(2, "Company name must be at least 2 characters"),
|
||||
cnpj: z.string().min(14, "CNPJ must have 14 digits"),
|
||||
email: z.string().email("Invalid email"),
|
||||
password: z.string().min(6, "Password must be at least 6 characters"),
|
||||
confirmPassword: z.string(),
|
||||
phone: z.string().min(10, "Phone must have at least 10 digits"),
|
||||
website: z.string().url("Website must be a valid URL").optional().or(z.literal("")),
|
||||
address: z.string().min(5, "Address must be at least 5 characters"),
|
||||
city: z.string().min(2, "City is required"),
|
||||
state: z.string().min(2, "State is required"),
|
||||
zipCode: z.string().min(8, "ZIP code must have 8 digits"),
|
||||
sector: z.string().min(1, "Industry is required"),
|
||||
companySize: z.string().min(1, "Company size is required"),
|
||||
description: z.string().min(20, "Description must be at least 20 characters"),
|
||||
contactPerson: z.string().min(2, "Contact name is required"),
|
||||
contactRole: z.string().min(2, "Contact role is required"),
|
||||
acceptTerms: z.boolean().refine(val => val === true, "You must accept the terms"),
|
||||
acceptNewsletter: z.boolean().optional(),
|
||||
}).refine(data => data.password === data.confirmPassword, {
|
||||
message: "Passwords do not match",
|
||||
path: ["confirmPassword"],
|
||||
});
|
||||
|
||||
type CompanyFormData = z.infer<typeof companySchema>;
|
||||
import { useTranslation } from "@/lib/i18n";
|
||||
import { LanguageSwitcher } from "@/components/language-switcher";
|
||||
|
||||
export default function CompanyRegisterPage() {
|
||||
const router = useRouter();
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
||||
const [currentStep, setCurrentStep] = useState(1);
|
||||
|
||||
const companySchema = z.object({
|
||||
companyName: z.string().min(2, t("register.company.form.errors.companyName")),
|
||||
cnpj: z.string().min(14, t("register.company.form.errors.cnpj")),
|
||||
email: z.string().email(t("register.company.form.errors.email")),
|
||||
password: z.string().min(6, t("register.company.form.errors.password")),
|
||||
confirmPassword: z.string(),
|
||||
phone: z.string().min(10, t("register.company.form.errors.phone")),
|
||||
website: z.string().url(t("register.company.form.errors.website")).optional().or(z.literal("")),
|
||||
address: z.string().min(5, t("register.company.form.errors.address")),
|
||||
city: z.string().min(2, t("register.company.form.errors.city")),
|
||||
state: z.string().min(2, t("register.company.form.errors.state")),
|
||||
zipCode: z.string().min(8, t("register.company.form.errors.zipCode")),
|
||||
sector: z.string().min(1, t("register.company.form.errors.industry")),
|
||||
companySize: z.string().min(1, t("register.company.form.errors.size")),
|
||||
description: z.string().min(20, t("register.company.form.errors.description")),
|
||||
contactPerson: z.string().min(2, t("register.company.form.errors.contactName")),
|
||||
contactRole: z.string().min(2, t("register.company.form.errors.contactRole")),
|
||||
acceptTerms: z.boolean().refine(val => val === true, t("register.company.form.errors.acceptTerms")),
|
||||
acceptNewsletter: z.boolean().optional(),
|
||||
}).refine(data => data.password === data.confirmPassword, {
|
||||
message: t("register.company.form.errors.passwordMismatch"),
|
||||
path: ["confirmPassword"],
|
||||
});
|
||||
|
||||
type CompanyFormData = z.infer<typeof companySchema>;
|
||||
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
|
|
@ -87,7 +81,6 @@ export default function CompanyRegisterPage() {
|
|||
|
||||
const acceptTerms = watch("acceptTerms");
|
||||
const acceptNewsletter = watch("acceptNewsletter");
|
||||
|
||||
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
||||
|
||||
const onSubmit = async (data: CompanyFormData) => {
|
||||
|
|
@ -103,17 +96,15 @@ export default function CompanyRegisterPage() {
|
|||
phone: data.phone,
|
||||
});
|
||||
|
||||
// Redirect to login after registration
|
||||
router.push("/login?message=Empresa registrada com sucesso! Faça login com seu email e a senha padrão: ChangeMe123!");
|
||||
} catch (error: any) {
|
||||
console.error("Registration error:", error);
|
||||
setErrorMsg(error.message || "Erro ao registrar empresa. Tente novamente.");
|
||||
setErrorMsg(error.message || t("register.company.form.errors.generic"));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const nextStep = () => {
|
||||
if (currentStep < 3) setCurrentStep(currentStep + 1);
|
||||
};
|
||||
|
|
@ -131,7 +122,7 @@ export default function CompanyRegisterPage() {
|
|||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-background to-muted/20 flex">
|
||||
{/* Left Panel - Information */}
|
||||
<div className="hidden lg:flex lg:flex-1 bg-gradient-to-br from-primary to-primary/80 p-8 flex-col justify-center items-center text-primary-foreground">
|
||||
<div className="hidden lg:flex lg:flex-1 bg-gradient-to-br from-primary to-primary/80 p-8 flex-col justify-center items-center text-primary-foreground relative">
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
|
|
@ -142,37 +133,40 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<h1 className="text-4xl font-bold mb-4">
|
||||
Register your company
|
||||
{t("register.company.title")}
|
||||
</h1>
|
||||
|
||||
<p className="text-lg opacity-90 leading-relaxed mb-6">
|
||||
Find top talent for your company.
|
||||
Post jobs and connect with qualified candidates.
|
||||
{t("register.company.subtitle")}
|
||||
</p>
|
||||
|
||||
<div className="space-y-4 text-left">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-2 h-2 bg-white rounded-full"></div>
|
||||
<span>Post jobs for free</span>
|
||||
<span>{t("register.company.bullets.free")}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-2 h-2 bg-white rounded-full"></div>
|
||||
<span>Access thousands of candidates</span>
|
||||
<span>{t("register.company.bullets.candidates")}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-2 h-2 bg-white rounded-full"></div>
|
||||
<span>Application management tools</span>
|
||||
<span>{t("register.company.bullets.tools")}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-2 h-2 bg-white rounded-full"></div>
|
||||
<span>Complete recruiting dashboard</span>
|
||||
<span>{t("register.company.bullets.dashboard")}</span>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
{/* Right Panel - Form */}
|
||||
<div className="flex-1 p-8 flex flex-col justify-center">
|
||||
<div className="flex-1 p-8 flex flex-col justify-center relative">
|
||||
<div className="absolute top-4 right-4">
|
||||
<LanguageSwitcher />
|
||||
</div>
|
||||
|
||||
<div className="w-full max-w-md mx-auto">
|
||||
{/* Header */}
|
||||
<div className="mb-6">
|
||||
|
|
@ -181,25 +175,25 @@ export default function CompanyRegisterPage() {
|
|||
className="inline-flex items-center gap-2 text-muted-foreground hover:text-foreground mb-4 transition-colors"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
Back to login
|
||||
{t("register.company.form.actions.backLogin")}
|
||||
</Link>
|
||||
|
||||
<h2 className="text-2xl font-bold text-foreground mb-2">
|
||||
Create account - company
|
||||
{t("register.company.form.title")}
|
||||
</h2>
|
||||
<p className="text-muted-foreground">
|
||||
Fill in your company details
|
||||
{t("register.company.form.subtitle")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Progress Indicator */}
|
||||
<div className="mb-8">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<span className="text-sm font-medium">Step {currentStep} of 3</span>
|
||||
<span className="text-sm font-medium">{t("register.company.form.steps.step", { current: currentStep, total: 3 })}</span>
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{currentStep === 1 && "Company details"}
|
||||
{currentStep === 2 && "Address & contact"}
|
||||
{currentStep === 3 && "Additional information"}
|
||||
{currentStep === 1 && t("register.company.form.steps.details")}
|
||||
{currentStep === 2 && t("register.company.form.steps.address")}
|
||||
{currentStep === 3 && t("register.company.form.steps.info")}
|
||||
</span>
|
||||
</div>
|
||||
<div className="w-full bg-muted rounded-full h-2">
|
||||
|
|
@ -222,13 +216,13 @@ export default function CompanyRegisterPage() {
|
|||
className="space-y-4"
|
||||
>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="companyName">Company name</Label>
|
||||
<Label htmlFor="companyName">{t("register.company.form.fields.companyName")}</Label>
|
||||
<div className="relative">
|
||||
<Building2 className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="companyName"
|
||||
type="text"
|
||||
placeholder="Your company name"
|
||||
placeholder={t("register.company.form.fields.companyNamePlaceholder")}
|
||||
className="pl-10"
|
||||
{...register("companyName")}
|
||||
/>
|
||||
|
|
@ -239,13 +233,13 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="cnpj">CNPJ</Label>
|
||||
<Label htmlFor="cnpj">{t("register.company.form.fields.cnpj")}</Label>
|
||||
<div className="relative">
|
||||
<FileText className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="cnpj"
|
||||
type="text"
|
||||
placeholder="00.000.000/0000-00"
|
||||
placeholder={t("register.company.form.fields.cnpjPlaceholder")}
|
||||
className="pl-10"
|
||||
{...register("cnpj")}
|
||||
/>
|
||||
|
|
@ -256,13 +250,13 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="email">Company email</Label>
|
||||
<Label htmlFor="email">{t("register.company.form.fields.email")}</Label>
|
||||
<div className="relative">
|
||||
<Mail className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="email"
|
||||
type="email"
|
||||
placeholder="hello@company.com"
|
||||
placeholder={t("register.company.form.fields.emailPlaceholder")}
|
||||
className="pl-10"
|
||||
{...register("email")}
|
||||
/>
|
||||
|
|
@ -273,13 +267,13 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
<Label htmlFor="password">{t("register.company.form.fields.password")}</Label>
|
||||
<div className="relative">
|
||||
<Lock className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Your password"
|
||||
placeholder={t("register.company.form.fields.passwordPlaceholder")}
|
||||
className="pl-10 pr-10"
|
||||
{...register("password")}
|
||||
/>
|
||||
|
|
@ -303,13 +297,13 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="confirmPassword">Confirm password</Label>
|
||||
<Label htmlFor="confirmPassword">{t("register.company.form.fields.confirmPassword")}</Label>
|
||||
<div className="relative">
|
||||
<Lock className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="confirmPassword"
|
||||
type={showConfirmPassword ? "text" : "password"}
|
||||
placeholder="Confirm your password"
|
||||
placeholder={t("register.company.form.fields.confirmPasswordPlaceholder")}
|
||||
className="pl-10 pr-10"
|
||||
{...register("confirmPassword")}
|
||||
/>
|
||||
|
|
@ -333,7 +327,7 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<Button type="button" onClick={nextStep} className="w-full">
|
||||
Next step
|
||||
{t("register.company.form.actions.next")}
|
||||
</Button>
|
||||
</motion.div>
|
||||
)}
|
||||
|
|
@ -349,13 +343,13 @@ export default function CompanyRegisterPage() {
|
|||
className="space-y-4"
|
||||
>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="phone">Phone</Label>
|
||||
<Label htmlFor="phone">{t("register.company.form.fields.phone")}</Label>
|
||||
<div className="relative">
|
||||
<Phone className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="phone"
|
||||
type="tel"
|
||||
placeholder="(11) 99999-9999"
|
||||
placeholder={t("register.company.form.fields.phonePlaceholder")}
|
||||
className="pl-10"
|
||||
{...register("phone")}
|
||||
/>
|
||||
|
|
@ -366,13 +360,13 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="website">Website (optional)</Label>
|
||||
<Label htmlFor="website">{t("register.company.form.fields.website")}</Label>
|
||||
<div className="relative">
|
||||
<Globe className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="website"
|
||||
type="url"
|
||||
placeholder="https://www.company.com"
|
||||
placeholder={t("register.company.form.fields.websitePlaceholder")}
|
||||
className="pl-10"
|
||||
{...register("website")}
|
||||
/>
|
||||
|
|
@ -383,13 +377,13 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="address">Address</Label>
|
||||
<Label htmlFor="address">{t("register.company.form.fields.address")}</Label>
|
||||
<div className="relative">
|
||||
<MapPin className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="address"
|
||||
type="text"
|
||||
placeholder="Street, number, suite"
|
||||
placeholder={t("register.company.form.fields.addressPlaceholder")}
|
||||
className="pl-10"
|
||||
{...register("address")}
|
||||
/>
|
||||
|
|
@ -401,11 +395,11 @@ export default function CompanyRegisterPage() {
|
|||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="city">City</Label>
|
||||
<Label htmlFor="city">{t("register.company.form.fields.city")}</Label>
|
||||
<Input
|
||||
id="city"
|
||||
type="text"
|
||||
placeholder="Sua cidade"
|
||||
placeholder={t("register.company.form.fields.cityPlaceholder")}
|
||||
{...register("city")}
|
||||
/>
|
||||
{errors.city && (
|
||||
|
|
@ -414,10 +408,10 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="state">State</Label>
|
||||
<Label htmlFor="state">{t("register.company.form.fields.state")}</Label>
|
||||
<Select onValueChange={(value) => setValue("state", value)}>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="State" />
|
||||
<SelectValue placeholder={t("register.company.form.fields.statePlaceholder")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="AC">Acre</SelectItem>
|
||||
|
|
@ -456,11 +450,11 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="zipCode">ZIP code</Label>
|
||||
<Label htmlFor="zipCode">{t("register.company.form.fields.zipCode")}</Label>
|
||||
<Input
|
||||
id="zipCode"
|
||||
type="text"
|
||||
placeholder="00000-000"
|
||||
placeholder={t("register.company.form.fields.zipCodePlaceholder")}
|
||||
{...register("zipCode")}
|
||||
/>
|
||||
{errors.zipCode && (
|
||||
|
|
@ -470,10 +464,10 @@ export default function CompanyRegisterPage() {
|
|||
|
||||
<div className="flex gap-4">
|
||||
<Button type="button" variant="outline" onClick={prevStep} className="flex-1">
|
||||
Back
|
||||
{t("register.company.form.actions.back")}
|
||||
</Button>
|
||||
<Button type="button" onClick={nextStep} className="flex-1">
|
||||
Next step
|
||||
{t("register.company.form.actions.next")}
|
||||
</Button>
|
||||
</div>
|
||||
</motion.div>
|
||||
|
|
@ -490,26 +484,26 @@ export default function CompanyRegisterPage() {
|
|||
className="space-y-4"
|
||||
>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="sector">Industry</Label>
|
||||
<Label htmlFor="sector">{t("register.company.form.fields.industry")}</Label>
|
||||
<Select onValueChange={(value) => setValue("sector", value)}>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select an industry" />
|
||||
<SelectValue placeholder={t("register.company.form.fields.industryPlaceholder")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="technology">Technology</SelectItem>
|
||||
<SelectItem value="finance">Finance</SelectItem>
|
||||
<SelectItem value="healthcare">Healthcare</SelectItem>
|
||||
<SelectItem value="education">Education</SelectItem>
|
||||
<SelectItem value="retail">Retail</SelectItem>
|
||||
<SelectItem value="construction">Construction</SelectItem>
|
||||
<SelectItem value="industry">Industry</SelectItem>
|
||||
<SelectItem value="services">Services</SelectItem>
|
||||
<SelectItem value="agriculture">Agriculture</SelectItem>
|
||||
<SelectItem value="transport">Transportation</SelectItem>
|
||||
<SelectItem value="energy">Energy</SelectItem>
|
||||
<SelectItem value="consulting">Consulting</SelectItem>
|
||||
<SelectItem value="marketing">Marketing</SelectItem>
|
||||
<SelectItem value="other">Other</SelectItem>
|
||||
<SelectItem value="technology">{t("register.company.industries.technology")}</SelectItem>
|
||||
<SelectItem value="finance">{t("register.company.industries.finance")}</SelectItem>
|
||||
<SelectItem value="healthcare">{t("register.company.industries.healthcare")}</SelectItem>
|
||||
<SelectItem value="education">{t("register.company.industries.education")}</SelectItem>
|
||||
<SelectItem value="retail">{t("register.company.industries.retail")}</SelectItem>
|
||||
<SelectItem value="construction">{t("register.company.industries.construction")}</SelectItem>
|
||||
<SelectItem value="industry">{t("register.company.industries.industry")}</SelectItem>
|
||||
<SelectItem value="services">{t("register.company.industries.services")}</SelectItem>
|
||||
<SelectItem value="agriculture">{t("register.company.industries.agriculture")}</SelectItem>
|
||||
<SelectItem value="transport">{t("register.company.industries.transport")}</SelectItem>
|
||||
<SelectItem value="energy">{t("register.company.industries.energy")}</SelectItem>
|
||||
<SelectItem value="consulting">{t("register.company.industries.consulting")}</SelectItem>
|
||||
<SelectItem value="marketing">{t("register.company.industries.marketing")}</SelectItem>
|
||||
<SelectItem value="other">{t("register.company.industries.other")}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
{errors.sector && (
|
||||
|
|
@ -518,18 +512,18 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="companySize">Company size</Label>
|
||||
<Label htmlFor="companySize">{t("register.company.form.fields.size")}</Label>
|
||||
<Select onValueChange={(value) => setValue("companySize", value)}>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Number of employees" />
|
||||
<SelectValue placeholder={t("register.company.form.fields.sizePlaceholder")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="1-10">1 to 10 employees</SelectItem>
|
||||
<SelectItem value="11-50">11 to 50 employees</SelectItem>
|
||||
<SelectItem value="51-200">51 to 200 employees</SelectItem>
|
||||
<SelectItem value="201-500">201 to 500 employees</SelectItem>
|
||||
<SelectItem value="501-1000">501 to 1000 employees</SelectItem>
|
||||
<SelectItem value="1000+">More than 1000 employees</SelectItem>
|
||||
<SelectItem value="1-10">{t("register.company.sizes.1-10")}</SelectItem>
|
||||
<SelectItem value="11-50">{t("register.company.sizes.11-50")}</SelectItem>
|
||||
<SelectItem value="51-200">{t("register.company.sizes.51-200")}</SelectItem>
|
||||
<SelectItem value="201-500">{t("register.company.sizes.201-500")}</SelectItem>
|
||||
<SelectItem value="501-1000">{t("register.company.sizes.501-1000")}</SelectItem>
|
||||
<SelectItem value="1000+">{t("register.company.sizes.1000+")}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
{errors.companySize && (
|
||||
|
|
@ -538,10 +532,10 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="description">Company description</Label>
|
||||
<Label htmlFor="description">{t("register.company.form.fields.description")}</Label>
|
||||
<Textarea
|
||||
id="description"
|
||||
placeholder="Describe your company, culture, values, and what you offer employees..."
|
||||
placeholder={t("register.company.form.fields.descriptionPlaceholder")}
|
||||
className="min-h-[100px]"
|
||||
{...register("description")}
|
||||
/>
|
||||
|
|
@ -552,11 +546,11 @@ export default function CompanyRegisterPage() {
|
|||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="contactPerson">Contact name</Label>
|
||||
<Label htmlFor="contactPerson">{t("register.company.form.fields.contactName")}</Label>
|
||||
<Input
|
||||
id="contactPerson"
|
||||
type="text"
|
||||
placeholder="Full name"
|
||||
placeholder={t("register.company.form.fields.contactNamePlaceholder")}
|
||||
{...register("contactPerson")}
|
||||
/>
|
||||
{errors.contactPerson && (
|
||||
|
|
@ -565,11 +559,11 @@ export default function CompanyRegisterPage() {
|
|||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="contactRole">Role</Label>
|
||||
<Label htmlFor="contactRole">{t("register.company.form.fields.contactRole")}</Label>
|
||||
<Input
|
||||
id="contactRole"
|
||||
type="text"
|
||||
placeholder="e.g. HR, Manager"
|
||||
placeholder={t("register.company.form.fields.contactRolePlaceholder")}
|
||||
{...register("contactRole")}
|
||||
/>
|
||||
{errors.contactRole && (
|
||||
|
|
@ -590,13 +584,13 @@ export default function CompanyRegisterPage() {
|
|||
htmlFor="acceptTerms"
|
||||
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||
>
|
||||
I accept the{" "}
|
||||
{t("register.company.form.fields.acceptTerms")}{" "}
|
||||
<Link href="/terms" className="text-primary hover:underline">
|
||||
Terms of Use
|
||||
{t("terms.title")}
|
||||
</Link>{" "}
|
||||
and{" "}
|
||||
{t("register.candidate.acceptTerms.and")}{" "}
|
||||
<Link href="/privacy" className="text-primary hover:underline">
|
||||
Privacy Policy
|
||||
{t("privacy.title")}
|
||||
</Link>
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -616,7 +610,7 @@ export default function CompanyRegisterPage() {
|
|||
htmlFor="acceptNewsletter"
|
||||
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||
>
|
||||
I want to receive recruiting tips and updates by email
|
||||
{t("register.company.form.fields.acceptNewsletter")}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -624,10 +618,10 @@ export default function CompanyRegisterPage() {
|
|||
|
||||
<div className="flex gap-4">
|
||||
<Button type="button" variant="outline" onClick={prevStep} className="flex-1">
|
||||
Back
|
||||
{t("register.company.form.actions.back")}
|
||||
</Button>
|
||||
<Button type="submit" disabled={loading} className="flex-1">
|
||||
{loading ? "Creating account..." : "Create account"}
|
||||
{loading ? t("register.company.form.actions.submitting") : t("register.company.form.actions.submit")}
|
||||
</Button>
|
||||
</div>
|
||||
</motion.div>
|
||||
|
|
@ -636,9 +630,9 @@ export default function CompanyRegisterPage() {
|
|||
|
||||
<div className="mt-6 text-center">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Already have an account?{" "}
|
||||
{t("register.company.form.actions.haveAccount")}{" "}
|
||||
<Link href="/login" className="text-primary hover:underline font-medium">
|
||||
Sign in
|
||||
{t("register.company.form.actions.signIn")}
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,27 +1,32 @@
|
|||
'use client';
|
||||
"use client";
|
||||
|
||||
import { useTranslation, locales } from '@/lib/i18n';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { useTranslation } from "@/lib/i18n";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu';
|
||||
import { Globe } from 'lucide-react';
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { Globe } from "lucide-react";
|
||||
|
||||
export function LanguageSwitcher() {
|
||||
const { locale, setLocale } = useTranslation();
|
||||
|
||||
const currentLocale = locales.find(l => l.code === locale);
|
||||
const locales = [
|
||||
{ code: "en" as const, name: "English", flag: "🇺🇸" },
|
||||
{ code: "es" as const, name: "Español", flag: "🇪🇸" },
|
||||
{ code: "pt-BR" as const, name: "Português", flag: "🇧🇷" },
|
||||
];
|
||||
|
||||
const currentLocale = locales.find((l) => l.code === locale) || locales[0];
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size="sm" className="gap-2">
|
||||
<Button variant="ghost" size="sm" className="w-12 px-0 gap-2">
|
||||
<Globe className="h-4 w-4" />
|
||||
<span className="hidden sm:inline">{currentLocale?.flag} {currentLocale?.name}</span>
|
||||
<span className="sm:hidden">{currentLocale?.flag}</span>
|
||||
<span className="sr-only">Toggle language</span>
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
|
|
@ -29,10 +34,11 @@ export function LanguageSwitcher() {
|
|||
<DropdownMenuItem
|
||||
key={l.code}
|
||||
onClick={() => setLocale(l.code)}
|
||||
className={locale === l.code ? 'bg-accent' : ''}
|
||||
className="flex items-center gap-2"
|
||||
>
|
||||
<span className="mr-2">{l.flag}</span>
|
||||
{l.name}
|
||||
<span className="text-lg">{l.flag}</span>
|
||||
<span>{l.name}</span>
|
||||
{locale === l.code && <span className="ml-auto text-xs opacity-50">✓</span>}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
</DropdownMenuContent>
|
||||
|
|
|
|||
|
|
@ -360,6 +360,115 @@
|
|||
"experience": "Professional experience is required",
|
||||
"acceptTerms": "You must accept the terms"
|
||||
}
|
||||
},
|
||||
"company": {
|
||||
"title": "Register your company",
|
||||
"subtitle": "Find top talent for your company. Post jobs and connect with qualified candidates.",
|
||||
"bullets": {
|
||||
"free": "Post jobs for free",
|
||||
"candidates": "Access thousands of candidates",
|
||||
"tools": "Application management tools",
|
||||
"dashboard": "Complete recruiting dashboard"
|
||||
},
|
||||
"form": {
|
||||
"title": "Create account - company",
|
||||
"subtitle": "Fill in your company details",
|
||||
"steps": {
|
||||
"details": "Company details",
|
||||
"address": "Address & contact",
|
||||
"info": "Additional information",
|
||||
"step": "Step {current} of {total}"
|
||||
},
|
||||
"fields": {
|
||||
"companyName": "Company name",
|
||||
"companyNamePlaceholder": "Your company name",
|
||||
"cnpj": "CNPJ",
|
||||
"cnpjPlaceholder": "00.000.000/0000-00",
|
||||
"email": "Company email",
|
||||
"emailPlaceholder": "hello@company.com",
|
||||
"password": "Password",
|
||||
"passwordPlaceholder": "Your password",
|
||||
"confirmPassword": "Confirm password",
|
||||
"confirmPasswordPlaceholder": "Confirm your password",
|
||||
"phone": "Phone",
|
||||
"phonePlaceholder": "(11) 99999-9999",
|
||||
"website": "Website (optional)",
|
||||
"websitePlaceholder": "https://www.company.com",
|
||||
"address": "Address",
|
||||
"addressPlaceholder": "Street, number, suite",
|
||||
"city": "City",
|
||||
"cityPlaceholder": "Your city",
|
||||
"state": "State",
|
||||
"statePlaceholder": "State",
|
||||
"zipCode": "ZIP code",
|
||||
"zipCodePlaceholder": "00000-000",
|
||||
"industry": "Industry",
|
||||
"industryPlaceholder": "Select an industry",
|
||||
"size": "Company size",
|
||||
"sizePlaceholder": "Number of employees",
|
||||
"description": "Company description",
|
||||
"descriptionPlaceholder": "Describe your company, culture, values, and what you offer employees...",
|
||||
"contactName": "Contact name",
|
||||
"contactNamePlaceholder": "Full name",
|
||||
"contactRole": "Role",
|
||||
"contactRolePlaceholder": "e.g. HR, Manager",
|
||||
"acceptTerms": "I accept the",
|
||||
"acceptNewsletter": "I want to receive recruiting tips and updates by email"
|
||||
},
|
||||
"actions": {
|
||||
"next": "Next step",
|
||||
"back": "Back",
|
||||
"submit": "Create account",
|
||||
"submitting": "Creating account...",
|
||||
"backLogin": "Back to login",
|
||||
"signIn": "Sign in",
|
||||
"haveAccount": "Already have an account?"
|
||||
},
|
||||
"errors": {
|
||||
"companyName": "Company name must be at least 2 characters",
|
||||
"cnpj": "CNPJ must have 14 digits",
|
||||
"email": "Invalid email",
|
||||
"password": "Password must be at least 6 characters",
|
||||
"passwordMismatch": "Passwords do not match",
|
||||
"phone": "Phone must have at least 10 digits",
|
||||
"website": "Website must be a valid URL",
|
||||
"address": "Address must be at least 5 characters",
|
||||
"city": "City is required",
|
||||
"state": "State is required",
|
||||
"zipCode": "ZIP code must have 8 digits",
|
||||
"industry": "Industry is required",
|
||||
"size": "Company size is required",
|
||||
"description": "Description must be at least 20 characters",
|
||||
"contactName": "Contact name is required",
|
||||
"contactRole": "Contact role is required",
|
||||
"acceptTerms": "You must accept the terms",
|
||||
"generic": "Error registering company. Please try again."
|
||||
}
|
||||
},
|
||||
"industries": {
|
||||
"technology": "Technology",
|
||||
"finance": "Finance",
|
||||
"healthcare": "Healthcare",
|
||||
"education": "Education",
|
||||
"retail": "Retail",
|
||||
"construction": "Construction",
|
||||
"industry": "Industry",
|
||||
"services": "Services",
|
||||
"agriculture": "Agriculture",
|
||||
"transport": "Transportation",
|
||||
"energy": "Energy",
|
||||
"consulting": "Consulting",
|
||||
"marketing": "Marketing",
|
||||
"other": "Other"
|
||||
},
|
||||
"sizes": {
|
||||
"1-10": "1 to 10 employees",
|
||||
"11-50": "11 to 50 employees",
|
||||
"51-200": "51 to 200 employees",
|
||||
"201-500": "201 to 500 employees",
|
||||
"501-1000": "501 to 1000 employees",
|
||||
"1000+": "More than 1000 employees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"privacy": {
|
||||
|
|
|
|||
|
|
@ -360,6 +360,115 @@
|
|||
"experience": "Experiência profissional é obrigatória",
|
||||
"acceptTerms": "Você deve aceitar os termos"
|
||||
}
|
||||
},
|
||||
"company": {
|
||||
"title": "Cadastre sua empresa",
|
||||
"subtitle": "Encontre os melhores talentos para sua empresa. Publique vagas e conecte-se com candidatos qualificados.",
|
||||
"bullets": {
|
||||
"free": "Publique vagas gratuitamente",
|
||||
"candidates": "Acesso a milhares de candidatos",
|
||||
"tools": "Ferramentas de gestão de candidaturas",
|
||||
"dashboard": "Dashboard completo de recrutamento"
|
||||
},
|
||||
"form": {
|
||||
"title": "Criar conta - empresa",
|
||||
"subtitle": "Preencha os dados da sua empresa",
|
||||
"steps": {
|
||||
"details": "Dados da empresa",
|
||||
"address": "Endereço e contato",
|
||||
"info": "Informações adicionais",
|
||||
"step": "Etapa {current} de {total}"
|
||||
},
|
||||
"fields": {
|
||||
"companyName": "Nome da empresa",
|
||||
"companyNamePlaceholder": "Nome da sua empresa",
|
||||
"cnpj": "CNPJ",
|
||||
"cnpjPlaceholder": "00.000.000/0000-00",
|
||||
"email": "E-mail corporativo",
|
||||
"emailPlaceholder": "ola@empresa.com",
|
||||
"password": "Senha",
|
||||
"passwordPlaceholder": "Sua senha",
|
||||
"confirmPassword": "Confirmar senha",
|
||||
"confirmPasswordPlaceholder": "Confirme sua senha",
|
||||
"phone": "Telefone",
|
||||
"phonePlaceholder": "(11) 99999-9999",
|
||||
"website": "Site (opcional)",
|
||||
"websitePlaceholder": "https://www.empresa.com.br",
|
||||
"address": "Endereço",
|
||||
"addressPlaceholder": "Rua, número, complemento",
|
||||
"city": "Cidade",
|
||||
"cityPlaceholder": "Sua cidade",
|
||||
"state": "Estado",
|
||||
"statePlaceholder": "Selecione",
|
||||
"zipCode": "CEP",
|
||||
"zipCodePlaceholder": "00000-000",
|
||||
"industry": "Setor",
|
||||
"industryPlaceholder": "Selecione um setor",
|
||||
"size": "Tamanho da empresa",
|
||||
"sizePlaceholder": "Número de funcionários",
|
||||
"description": "Descrição da empresa",
|
||||
"descriptionPlaceholder": "Descreva a cultura, valores e o que a empresa oferece...",
|
||||
"contactName": "Nome do contato",
|
||||
"contactNamePlaceholder": "Nome completo",
|
||||
"contactRole": "Cargo",
|
||||
"contactRolePlaceholder": "Ex: RH, Gerente",
|
||||
"acceptTerms": "Aceito os",
|
||||
"acceptNewsletter": "Quero receber dicas de recrutamento e novidades por e-mail"
|
||||
},
|
||||
"actions": {
|
||||
"next": "Próxima etapa",
|
||||
"back": "Voltar",
|
||||
"submit": "Criar conta",
|
||||
"submitting": "Criando conta...",
|
||||
"backLogin": "Voltar ao login",
|
||||
"signIn": "Entrar",
|
||||
"haveAccount": "Já tem uma conta?"
|
||||
},
|
||||
"errors": {
|
||||
"companyName": "Nome da empresa deve ter pelo menos 2 caracteres",
|
||||
"cnpj": "CNPJ deve ter 14 dígitos",
|
||||
"email": "E-mail inválido",
|
||||
"password": "Senha deve ter pelo menos 6 caracteres",
|
||||
"passwordMismatch": "Senhas não coincidem",
|
||||
"phone": "Telefone deve ter pelo menos 10 dígitos",
|
||||
"website": "Site deve ser uma URL válida",
|
||||
"address": "Endereço deve ter pelo menos 5 caracteres",
|
||||
"city": "Cidade é obrigatória",
|
||||
"state": "Estado é obrigatório",
|
||||
"zipCode": "CEP deve ter 8 dígitos",
|
||||
"industry": "Setor é obrigatório",
|
||||
"size": "Tamanho da empresa é obrigatório",
|
||||
"description": "Descrição deve ter pelo menos 20 caracteres",
|
||||
"contactName": "Nome do contato é obrigatório",
|
||||
"contactRole": "Cargo de contato é obrigatório",
|
||||
"acceptTerms": "Você deve aceitar os termos",
|
||||
"generic": "Erro ao registrar empresa. Tente novamente."
|
||||
}
|
||||
},
|
||||
"industries": {
|
||||
"technology": "Tecnologia",
|
||||
"finance": "Finanças",
|
||||
"healthcare": "Saúde",
|
||||
"education": "Educação",
|
||||
"retail": "Varejo",
|
||||
"construction": "Construção",
|
||||
"industry": "Indústria",
|
||||
"services": "Serviços",
|
||||
"agriculture": "Agricultura",
|
||||
"transport": "Transporte",
|
||||
"energy": "Energia",
|
||||
"consulting": "Consultoria",
|
||||
"marketing": "Marketing",
|
||||
"other": "Outros"
|
||||
},
|
||||
"sizes": {
|
||||
"1-10": "1 a 10 funcionários",
|
||||
"11-50": "11 a 50 funcionários",
|
||||
"51-200": "51 a 200 funcionários",
|
||||
"201-500": "201 a 500 funcionários",
|
||||
"501-1000": "501 a 1000 funcionários",
|
||||
"1000+": "Mais de 1000 funcionários"
|
||||
}
|
||||
}
|
||||
},
|
||||
"privacy": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue