refactor: extract Icons and InlineFormActions UI components
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m28s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m28s
- Add Icons.tsx: IconEdit, IconTrash, IconDuplicate, IconPlus, IconCheck, IconClose - Add InlineFormActions.tsx: unified Annuler/Ajouter-Enregistrer button pair - Replace inline SVGs in SwotCard, YearReviewCard, WeeklyCheckInCard, SwotQuadrant, YearReviewSection, WeeklyCheckInSection, EditableTitle, Modal, GifMoodCard Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
39
src/components/ui/InlineFormActions.tsx
Normal file
39
src/components/ui/InlineFormActions.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
interface InlineFormActionsProps {
|
||||
onCancel: () => void;
|
||||
onSubmit: () => void;
|
||||
isPending: boolean;
|
||||
disabled?: boolean;
|
||||
submitLabel?: string;
|
||||
submitColorClass?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function InlineFormActions({
|
||||
onCancel,
|
||||
onSubmit,
|
||||
isPending,
|
||||
disabled = false,
|
||||
submitLabel = 'Ajouter',
|
||||
submitColorClass = 'text-primary hover:bg-primary/10',
|
||||
className = '',
|
||||
}: InlineFormActionsProps) {
|
||||
return (
|
||||
<div className={`flex justify-end gap-1 ${className}`}>
|
||||
<button
|
||||
onClick={onCancel}
|
||||
className="rounded px-2 py-1 text-xs text-muted hover:bg-card-hover"
|
||||
disabled={isPending}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
<button
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={onSubmit}
|
||||
disabled={isPending || disabled}
|
||||
className={`rounded px-2 py-1 text-xs font-medium disabled:opacity-50 ${submitColorClass}`}
|
||||
>
|
||||
{isPending ? '...' : submitLabel}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user