style: padroniza layout do formulário de criação de empresas com o de vagas
This commit is contained in:
parent
a754b4eba8
commit
007a708ffe
1 changed files with 217 additions and 162 deletions
|
|
@ -6,11 +6,11 @@ import { Button } from "@/components/ui/button"
|
|||
import { Input } from "@/components/ui/input"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Loader2, Eye, EyeOff, ArrowLeft } from "lucide-react"
|
||||
import { Loader2, Eye, EyeOff, ArrowLeft, Building2 } from "lucide-react"
|
||||
import { adminCompaniesApi } from "@/lib/api"
|
||||
import { toast } from "sonner"
|
||||
import { useTranslation } from "@/lib/i18n"
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import Link from "next/link"
|
||||
|
||||
const formatCNPJ = (value: string) => {
|
||||
|
|
@ -85,22 +85,39 @@ export default function NewCompanyPage() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-8 max-w-3xl mx-auto">
|
||||
<div className="flex items-center gap-4">
|
||||
<Button variant="ghost" size="icon" asChild>
|
||||
<Link href="/dashboard/companies">
|
||||
<ArrowLeft className="h-5 w-5" />
|
||||
<div className="container max-w-4xl py-10">
|
||||
<div className="mb-8">
|
||||
<Button variant="ghost" size="sm" asChild className="mb-4">
|
||||
<Link href="/dashboard/companies" className="flex items-center gap-2">
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
{t('admin.companies.create.backToList', { defaultValue: 'Voltar para lista' })}
|
||||
</Link>
|
||||
</Button>
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold text-foreground">{t('admin.companies.create.title')}</h1>
|
||||
<p className="text-muted-foreground mt-1">{t('admin.companies.create.subtitle')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<CardContent className="pt-6">
|
||||
<div className="grid gap-6">
|
||||
<Card className="border-0 shadow-lg">
|
||||
<CardHeader className="bg-muted/50 pb-8 pt-8">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="bg-primary/10 p-3 rounded-xl">
|
||||
<Building2 className="h-8 w-8 text-primary" />
|
||||
</div>
|
||||
<div>
|
||||
<CardTitle className="text-2xl font-bold">{t('admin.companies.create.title')}</CardTitle>
|
||||
<CardDescription className="text-base mt-1">
|
||||
{t('admin.companies.create.subtitle')}
|
||||
</CardDescription>
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-8">
|
||||
<div className="grid gap-8">
|
||||
{/* Seção: Informações Básicas */}
|
||||
<div className="grid gap-4">
|
||||
<h3 className="text-lg font-semibold border-b pb-2 flex items-center gap-2">
|
||||
<span className="bg-primary w-1 h-5 rounded-full"></span>
|
||||
{t('admin.companies.sections.basicInfo', { defaultValue: 'Informações Básicas' })}
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="name">{t('admin.companies.create.name')}</Label>
|
||||
<Input
|
||||
|
|
@ -125,6 +142,8 @@ export default function NewCompanyPage() {
|
|||
placeholder={t('admin.companies.create.slugPlaceholder')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="document">{t('admin.companies.fields.document')}</Label>
|
||||
<Input
|
||||
|
|
@ -145,6 +164,15 @@ export default function NewCompanyPage() {
|
|||
placeholder={t('admin.companies.create.emailPlaceholder')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Seção: Segurança */}
|
||||
<div className="grid gap-4">
|
||||
<h3 className="text-lg font-semibold border-b pb-2 flex items-center gap-2">
|
||||
<span className="bg-primary w-1 h-5 rounded-full"></span>
|
||||
{t('admin.companies.sections.security', { defaultValue: 'Segurança' })}
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="password">{t('admin.companies.fields.password')}</Label>
|
||||
|
|
@ -200,6 +228,15 @@ export default function NewCompanyPage() {
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Seção: Contato e Localização */}
|
||||
<div className="grid gap-4">
|
||||
<h3 className="text-lg font-semibold border-b pb-2 flex items-center gap-2">
|
||||
<span className="bg-primary w-1 h-5 rounded-full"></span>
|
||||
{t('admin.companies.sections.contact', { defaultValue: 'Contato e Localização' })}
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="phone">{t('admin.companies.fields.phone')}</Label>
|
||||
<Input
|
||||
|
|
@ -207,7 +244,7 @@ export default function NewCompanyPage() {
|
|||
maxLength={15}
|
||||
value={formData.phone}
|
||||
onChange={(e) => setFormData({ ...formData, phone: formatPhone(e.target.value) })}
|
||||
placeholder="+55 11 99999-9999"
|
||||
placeholder="(99) 99999-9999"
|
||||
/>
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
|
|
@ -216,28 +253,38 @@ export default function NewCompanyPage() {
|
|||
id="website"
|
||||
value={formData.website}
|
||||
onChange={(e) => setFormData({ ...formData, website: e.target.value })}
|
||||
placeholder="https://..."
|
||||
placeholder="https://example.com"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="address">{t('admin.companies.fields.address')}</Label>
|
||||
<Input
|
||||
id="address"
|
||||
value={formData.address}
|
||||
onChange={(e) => setFormData({ ...formData, address: e.target.value })}
|
||||
placeholder="Address..."
|
||||
placeholder="Endereço completo"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Seção: Detalhes da Empresa */}
|
||||
<div className="grid gap-4">
|
||||
<h3 className="text-lg font-semibold border-b pb-2 flex items-center gap-2">
|
||||
<span className="bg-primary w-1 h-5 rounded-full"></span>
|
||||
{t('admin.companies.sections.details', { defaultValue: 'Detalhes Adicionais' })}
|
||||
</h3>
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="description">{t('admin.companies.fields.description')}</Label>
|
||||
<Textarea
|
||||
id="description"
|
||||
value={formData.description}
|
||||
onChange={(e) => setFormData({ ...formData, description: e.target.value })}
|
||||
placeholder="Company description..."
|
||||
className="min-h-[120px]"
|
||||
placeholder="Conte um pouco sobre a empresa..."
|
||||
className="min-h-[120px] resize-none"
|
||||
/>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="logoUrl">Logo URL</Label>
|
||||
<Input
|
||||
|
|
@ -251,19 +298,27 @@ export default function NewCompanyPage() {
|
|||
<Label htmlFor="yearsInMarket">Anos no mercado</Label>
|
||||
<Input
|
||||
id="yearsInMarket"
|
||||
type="number"
|
||||
value={formData.yearsInMarket}
|
||||
onChange={(e) => setFormData({ ...formData, yearsInMarket: e.target.value })}
|
||||
placeholder="Ex: 10"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex justify-end gap-4 pt-4 border-t">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end gap-4 pt-6 mt-4 border-t">
|
||||
<Button variant="outline" asChild>
|
||||
<Link href="/dashboard/companies">
|
||||
{t('admin.companies.create.cancel')}
|
||||
</Link>
|
||||
</Button>
|
||||
<Button onClick={handleCreate} disabled={creating}>
|
||||
{creating && <Loader2 className="h-4 w-4 mr-2 animate-spin" />}
|
||||
<Button onClick={handleCreate} disabled={creating} className="min-w-[140px]">
|
||||
{creating ? (
|
||||
<Loader2 className="h-4 w-4 mr-2 animate-spin" />
|
||||
) : (
|
||||
<Building2 className="h-4 w-4 mr-2" />
|
||||
)}
|
||||
{t('admin.companies.create.submit')}
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue