3042ddca38
- /wa-inbox, /wa-sessions e /wa-secretaria rodam sem a sidebar do scoreodonto (isStandaloneView); cada tela tem seu "Voltar" (Secretária ganhou botão na ThinNav). - SessionsView: banner "Você já possui acesso ao WhatsApp" quando há sessão ativa. - avatares: usa a URL do CDN (contactAvatarUrl/instance.avatar) direto; Avatar exibe sem depender de version; self-heal no onError re-busca a foto atual. - deps: framer-motion, immer. Dev override com HMR (docker-compose.dev.yml). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
import { Check, AlertCircle } from 'lucide-react';
|
|
|
|
interface ToastProps {
|
|
message: string;
|
|
type: 'success' | 'error';
|
|
visible: boolean;
|
|
}
|
|
|
|
export default function Toast({ message, type, visible }: ToastProps) {
|
|
return (
|
|
<AnimatePresence>
|
|
{visible && (
|
|
<motion.div
|
|
initial={{ opacity: 0, x: 40 }}
|
|
animate={{ opacity: 1, x: 0 }}
|
|
exit={{ opacity: 0, x: 40 }}
|
|
className={`
|
|
fixed top-6 right-6 z-[300] flex items-center gap-3 px-5 py-3.5 rounded-2xl
|
|
glass-elevated shadow-premium text-sm font-semibold text-white
|
|
${type === 'success' ? 'border-l-4 border-l-emerald-500' : 'border-l-4 border-l-red-500'}
|
|
`}
|
|
>
|
|
{type === 'success' ? (
|
|
<Check className="w-4 h-4 text-emerald-400" />
|
|
) : (
|
|
<AlertCircle className="w-4 h-4 text-red-400" />
|
|
)}
|
|
{message}
|
|
</motion.div>
|
|
)}
|
|
</AnimatePresence>
|
|
);
|
|
}
|