2025-07-11 11:31:28 +02:00
|
|
|
import { DiffCard } from '@/components/tasks/TaskDetails/DiffCard.tsx';
|
|
|
|
|
import { useContext } from 'react';
|
2025-07-11 19:27:33 +02:00
|
|
|
import { TaskDiffContext } from '@/components/context/taskDetailsContext.ts';
|
2025-07-15 08:18:05 +02:00
|
|
|
import { Loader } from '@/components/ui/loader';
|
2025-07-11 11:31:28 +02:00
|
|
|
|
|
|
|
|
function DiffTab() {
|
2025-07-11 19:27:33 +02:00
|
|
|
const { diff, diffLoading, diffError } = useContext(TaskDiffContext);
|
2025-07-11 11:31:28 +02:00
|
|
|
|
|
|
|
|
if (diffLoading) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex items-center justify-center h-32">
|
2025-07-15 08:18:05 +02:00
|
|
|
<Loader message="Loading changes..." size={32} />
|
2025-07-11 11:31:28 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (diffError) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="text-center py-8 text-destructive">
|
|
|
|
|
<p>{diffError}</p>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="h-full px-4 pb-4">
|
|
|
|
|
<DiffCard diff={diff} deletable compact={false} className="h-full" />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default DiffTab;
|