Mission Refactor Big
This commit is contained in:
parent
b4c019925f
commit
3e4c0cba05
@ -374,6 +374,18 @@ export default function MissionDetailPage() {
|
||||
<FileText className="h-4 w-4 mr-2" />
|
||||
Général
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
value="documents"
|
||||
className="data-[state=active]:bg-blue-600 data-[state=active]:text-white px-6 py-2"
|
||||
>
|
||||
<FileIcon className="h-4 w-4 mr-2" />
|
||||
Documents
|
||||
{mission.attachments && mission.attachments.length > 0 && (
|
||||
<span className="ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full">
|
||||
{mission.attachments.length}
|
||||
</span>
|
||||
)}
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
value="plan"
|
||||
className="data-[state=active]:bg-blue-600 data-[state=active]:text-white px-6 py-2"
|
||||
@ -496,34 +508,6 @@ export default function MissionDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Attachments */}
|
||||
{mission.attachments && mission.attachments.length > 0 && (
|
||||
<div className="bg-white rounded-lg shadow-sm border border-gray-100 p-6">
|
||||
<h2 className="text-xl font-semibold text-gray-800 mb-4">Documents</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
||||
{mission.attachments.map((attachment) => (
|
||||
<a
|
||||
key={attachment.id}
|
||||
href={attachment.publicUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="bg-green-50 p-4 rounded-lg flex flex-col hover:bg-green-100 transition-colors"
|
||||
>
|
||||
<div className="text-green-700 mb-2">
|
||||
<FileIcon className="h-10 w-10" />
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-medium text-gray-800 mb-1 truncate">{attachment.filename}</p>
|
||||
<p className="text-sm text-gray-500">
|
||||
{attachment.fileType.split('/')[1]?.toUpperCase() || 'Fichier'}
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Delete Button */}
|
||||
<div className="flex justify-end">
|
||||
<Button
|
||||
@ -542,6 +526,52 @@ export default function MissionDetailPage() {
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Documents Tab */}
|
||||
<TabsContent value="documents" className="space-y-6">
|
||||
<div className="bg-white rounded-lg shadow-sm border border-gray-100 p-6">
|
||||
<h2 className="text-xl font-semibold text-gray-800 mb-4">Documents attachés</h2>
|
||||
|
||||
{mission.attachments && mission.attachments.length > 0 ? (
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
||||
{mission.attachments.map((attachment) => (
|
||||
<a
|
||||
key={attachment.id}
|
||||
href={attachment.publicUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="bg-green-50 p-4 rounded-lg flex flex-col hover:bg-green-100 transition-colors border border-green-100"
|
||||
>
|
||||
<div className="text-green-700 mb-2">
|
||||
<FileIcon className="h-10 w-10" />
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-medium text-gray-800 mb-1 truncate">{attachment.filename}</p>
|
||||
<p className="text-sm text-gray-500">
|
||||
{attachment.fileType.split('/')[1]?.toUpperCase() || 'Fichier'}
|
||||
</p>
|
||||
<p className="text-xs text-gray-400 mt-1">
|
||||
{(attachment.fileSize / 1024).toFixed(1)} KB
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center py-12 text-center">
|
||||
<div className="w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mb-4">
|
||||
<FileIcon className="h-8 w-8 text-gray-400" />
|
||||
</div>
|
||||
<h3 className="text-lg font-medium text-gray-900 mb-2">
|
||||
Aucun document
|
||||
</h3>
|
||||
<p className="text-gray-500 max-w-md">
|
||||
Cette mission n'a pas de documents attachés.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Plan d'actions Tab */}
|
||||
<TabsContent value="plan" className="space-y-6">
|
||||
<div className="bg-white rounded-lg shadow-sm border border-gray-100 p-6">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user