diff --git a/frontend/src/components/footer.tsx b/frontend/src/components/footer.tsx index 7c1177e..6a8a8d4 100644 --- a/frontend/src/components/footer.tsx +++ b/frontend/src/components/footer.tsx @@ -26,6 +26,18 @@ export function Footer() { {t("footerMain.info.contact")} +
  • + + + {t("footerMain.info.terms") || "Termos de Uso"} + +
  • +
  • + + + {t("footerMain.info.privacy") || "Política de Privacidade"} + +
  • diff --git a/frontend/src/components/job-card.tsx b/frontend/src/components/job-card.tsx index bd4d237..267d698 100644 --- a/frontend/src/components/job-card.tsx +++ b/frontend/src/components/job-card.tsx @@ -9,14 +9,25 @@ import { } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { MapPin, Briefcase, Clock, Building2, - Heart, + Share2, Zap, + Link2, + MessageCircle, + Linkedin, + Twitter, + Facebook } from "lucide-react"; import Link from "next/link"; import { motion } from "framer-motion"; @@ -35,53 +46,27 @@ interface JobCardProps { export function JobCard({ job, isApplied, applicationStatus }: JobCardProps) { const { t } = useTranslation(); const { user } = useAuth(); - const [isFavorited, setIsFavorited] = useState(false); - const [isLoading, setIsLoading] = useState(true); - const notify = useNotify(); + const handleShare = (platform: string) => { + const url = typeof window !== "undefined" ? `${window.location.origin}/jobs/${job.id}` : `https://local.gohorsejobs.com/jobs/${job.id}`; + const text = `Confira esta vaga: ${job.title} na ${job.company}`; - useEffect(() => { - const checkFavorite = async () => { - if (!user) { - setIsLoading(false); - return; - } - try { - const res = await jobsApi.checkFavorite(job.id); - setIsFavorited(res.isFavorite); - } catch { - // User not logged in or error - ignore - } finally { - setIsLoading(false); - } - }; - checkFavorite(); - }, [job.id, user]); - - const handleFavorite = async () => { - if (isLoading) return; - if (!user) { - notify.error("Erro", "Faça login para salvar vagas."); - return; - } - - try { - if (isFavorited) { - await jobsApi.removeFavorite(job.id); - setIsFavorited(false); - } else { - await jobsApi.addFavorite(job.id); - setIsFavorited(true); - notify.info( - t('jobs.favorites.added.title'), - t('jobs.favorites.added.desc', { title: job.title }), - { - actionUrl: "/dashboard/favorites", - actionLabel: t('jobs.favorites.action'), - } - ); - } - } catch { - notify.error("Erro", "Faça login para salvar vagas."); + switch (platform) { + case 'whatsapp': + window.open(`https://wa.me/?text=${encodeURIComponent(text + " " + url)}`, '_blank'); + break; + case 'linkedin': + window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(url)}`, '_blank'); + break; + case 'twitter': + window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`, '_blank'); + break; + case 'facebook': + window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(url)}`, '_blank'); + break; + case 'copy': + navigator.clipboard.writeText(url); + notify.success("Link copiado!", "Link da vaga copiado para a área de transferência."); + break; } }; @@ -169,19 +154,30 @@ export function JobCard({ job, isApplied, applicationStatus }: JobCardProps) { - + + + + + + handleShare('whatsapp')} className="gap-2 cursor-pointer"> + WhatsApp + + handleShare('linkedin')} className="gap-2 cursor-pointer"> + LinkedIn + + handleShare('twitter')} className="gap-2 cursor-pointer"> + Twitter/X + + handleShare('facebook')} className="gap-2 cursor-pointer"> + Facebook + + handleShare('copy')} className="gap-2 cursor-pointer border-t mt-1 pt-1"> + Copiar Link + + + diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 8b10320..56e39d2 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -1379,7 +1379,9 @@ "info": { "title": "Information", "about": "About Us", - "contact": "Contact" + "contact": "Contact", + "terms": "Terms of Use", + "privacy": "Privacy Policy" }, "candidates": { "title": "For Candidates", diff --git a/frontend/src/i18n/es.json b/frontend/src/i18n/es.json index 5b78390..c02248b 100644 --- a/frontend/src/i18n/es.json +++ b/frontend/src/i18n/es.json @@ -1380,7 +1380,9 @@ "info": { "title": "Información", "about": "Sobre nosotros", - "contact": "Contacto" + "contact": "Contacto", + "terms": "Términos de Uso", + "privacy": "Política de Privacidad" }, "candidates": { "title": "Para Candidatos", diff --git a/frontend/src/i18n/pt-BR.json b/frontend/src/i18n/pt-BR.json index df60a5a..e7666be 100644 --- a/frontend/src/i18n/pt-BR.json +++ b/frontend/src/i18n/pt-BR.json @@ -1386,9 +1386,11 @@ }, "footerMain": { "info": { - "title": "Informações", + "title": "Informação", "about": "Sobre nós", - "contact": "Contato" + "contact": "Contato", + "terms": "Termos de Uso", + "privacy": "Política de Privacidade" }, "candidates": { "title": "Para Candidatos",