Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions frontend/src/pages/CaseDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const CaseDetail = ({ caseData, onBack, onGoToPet, currentUserId, userRole, onDi
const [editedDescription, setEditedDescription] = useState(caseData?.description || '');
const [editedTitle, setEditedTitle] = useState(caseData?.title || '');

const messagesEndRef = useRef(null);
const statusConfig = STATUS_MAP[localStatus] || { label: localStatus, color: 'bg-slate-50 text-slate-500 border-slate-100' };

const isClosed = localStatus === 'CLOSED'; // Helper för att förenkla checkar
Expand Down Expand Up @@ -65,14 +64,6 @@ const CaseDetail = ({ caseData, onBack, onGoToPet, currentUserId, userRole, onDi
}
}, [caseData?.id]);

const scrollToBottom = () => {
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
};

useEffect(() => {
if (timeline.length > 0) scrollToBottom();
}, [timeline]);

useEffect(() => {
const fetchAllData = async () => {
if (!caseData?.id) return;
Expand Down Expand Up @@ -224,7 +215,7 @@ const CaseDetail = ({ caseData, onBack, onGoToPet, currentUserId, userRole, onDi
if (!caseData || loading) return <div className="p-10 text-center italic text-slate-400">Laddar journal...</div>;

return (
<div className="max-w-6xl mx-auto space-y-8 animate-in fade-in slide-in-from-right-4 duration-500 pb-20 text-left">
<div className="max-w-6xl mx-auto space-y-8 pb-20 text-left">
{/* NAVIGATION */}
<button onClick={onBack} className="flex items-center gap-2 text-slate-400 hover:text-vet-navy font-bold text-[10px] uppercase tracking-[0.2em] transition group">
<span className="group-hover:-translate-x-1 transition-transform">←</span> Tillbaka till listan
Expand Down Expand Up @@ -390,7 +381,6 @@ const CaseDetail = ({ caseData, onBack, onGoToPet, currentUserId, userRole, onDi
</div>
</div>
))}
<div ref={messagesEndRef} />
</div>
</div>

Expand Down Expand Up @@ -457,7 +447,6 @@ const CaseDetail = ({ caseData, onBack, onGoToPet, currentUserId, userRole, onDi
</div>
</div>
</div>

{/* CLOSE CASE MODAL */}
{showCloseModal && (
<div className="fixed inset-0 bg-slate-900/80 backdrop-blur-sm z-[100] flex items-center justify-center p-4">
Expand Down