Mission Refactor Big
This commit is contained in:
parent
eadc63daf0
commit
b4c019925f
@ -592,16 +592,52 @@ export default function MissionDetailPage() {
|
|||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<Textarea
|
<Textarea
|
||||||
value={editedPlan}
|
value={editedPlan}
|
||||||
onChange={(e) => setEditedPlan(e.target.value)}
|
onChange={(e) => {
|
||||||
|
setEditedPlan(e.target.value);
|
||||||
|
// Auto-resize textarea
|
||||||
|
e.target.style.height = 'auto';
|
||||||
|
e.target.style.height = e.target.scrollHeight + 'px';
|
||||||
|
}}
|
||||||
placeholder="Le plan d'action généré apparaîtra ici. Vous pouvez le modifier après génération."
|
placeholder="Le plan d'action généré apparaîtra ici. Vous pouvez le modifier après génération."
|
||||||
className="min-h-[400px] font-mono text-sm bg-white text-gray-900 border-gray-300 focus:border-blue-500 focus:ring-blue-500"
|
className="min-h-[600px] font-mono text-sm bg-white text-gray-900 border-gray-300 focus:border-blue-500 focus:ring-blue-500 resize-none overflow-hidden"
|
||||||
|
style={{ height: 'auto' }}
|
||||||
|
ref={(textarea) => {
|
||||||
|
// Auto-resize on mount
|
||||||
|
if (textarea) {
|
||||||
|
textarea.style.height = 'auto';
|
||||||
|
textarea.style.height = Math.max(600, textarea.scrollHeight) + 'px';
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
{isPlanModified && (
|
|
||||||
<p className="text-sm text-amber-600 flex items-center gap-1">
|
{/* Bottom action bar */}
|
||||||
<span className="w-2 h-2 bg-amber-500 rounded-full"></span>
|
<div className="flex items-center justify-between pt-4 border-t border-gray-200">
|
||||||
Modifications non sauvegardées
|
{isPlanModified ? (
|
||||||
</p>
|
<>
|
||||||
)}
|
<p className="text-sm text-amber-600 flex items-center gap-1">
|
||||||
|
<span className="w-2 h-2 bg-amber-500 rounded-full"></span>
|
||||||
|
Modifications non sauvegardées
|
||||||
|
</p>
|
||||||
|
<Button
|
||||||
|
onClick={handleSavePlan}
|
||||||
|
disabled={savingPlan}
|
||||||
|
className="bg-green-600 hover:bg-green-700 text-white"
|
||||||
|
>
|
||||||
|
{savingPlan ? (
|
||||||
|
<Loader2 className="h-4 w-4 mr-2 animate-spin" />
|
||||||
|
) : (
|
||||||
|
<Save className="h-4 w-4 mr-2" />
|
||||||
|
)}
|
||||||
|
Sauvegarder les modifications
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<p className="text-sm text-green-600 flex items-center gap-1">
|
||||||
|
<span className="w-2 h-2 bg-green-500 rounded-full"></span>
|
||||||
|
Plan sauvegardé
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex flex-col items-center justify-center py-16 text-center">
|
<div className="flex flex-col items-center justify-center py-16 text-center">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user