* tiny fix * Move all api calls from components to lib/api.ts (vibe-kanban) (#165) * unify loaders * simplify scroll to bottom logic for logs * better key for display entry * finish normalising api calls * remove withErrorHandling function * cleanup
33 lines
820 B
TypeScript
33 lines
820 B
TypeScript
import { DiffCard } from '@/components/tasks/TaskDetails/DiffCard.tsx';
|
|
import { useContext } from 'react';
|
|
import { TaskDiffContext } from '@/components/context/taskDetailsContext.ts';
|
|
import { Loader } from '@/components/ui/loader';
|
|
|
|
function DiffTab() {
|
|
const { diff, diffLoading, diffError } = useContext(TaskDiffContext);
|
|
|
|
if (diffLoading) {
|
|
return (
|
|
<div className="flex items-center justify-center h-32">
|
|
<Loader message="Loading changes..." size={32} />
|
|
</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;
|