diff --git a/src/components/suggestions/NewSuggestionForm.tsx b/src/components/suggestions/NewSuggestionForm.tsx new file mode 100644 index 0000000..0c356cd --- /dev/null +++ b/src/components/suggestions/NewSuggestionForm.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import { Card } from '@/components/ui/card'; +import { Button } from '@/components/ui/button'; +import { Input } from '@/components/ui/input'; + +interface NewSuggestionFormProps { + newSuggestion: { + title: string; + description: string; + }; + onCancel: () => void; + onSubmit: () => void; + onChange: (field: 'title' | 'description', value: string) => void; +} + +export function NewSuggestionForm({ newSuggestion, onCancel, onSubmit, onChange }: NewSuggestionFormProps) { + return ( + + + onChange('title', e.target.value)} + className="border-2 focus:border-[#FF9633] transition-all duration-200 rounded-xl" + /> + onChange('description', e.target.value)} + className="w-full p-4 border-2 rounded-xl h-32 focus:outline-none focus:border-[#FF9633] transition-all duration-200 bg-white resize-none" + /> + + + Annuler + + + Publier la suggestion + + + + + ); +} \ No newline at end of file diff --git a/src/components/suggestions/SuggestionCard.tsx b/src/components/suggestions/SuggestionCard.tsx new file mode 100644 index 0000000..1b74577 --- /dev/null +++ b/src/components/suggestions/SuggestionCard.tsx @@ -0,0 +1,70 @@ +import React from 'react'; +import { Card } from '@/components/ui/card'; +import { Button } from '@/components/ui/button'; +import { ChevronUp, ChevronDown } from 'lucide-react'; + +interface SuggestionCardProps { + suggestion: { + id: string; + title: string; + description: string; + votes: number; + status: string; + author: string; + date: string; + }; + onVote: (id: string, increment: boolean) => void; +} + +export function SuggestionCard({ suggestion, onVote }: SuggestionCardProps) { + return ( + + + + onVote(suggestion.id, true)} + > + + + {suggestion.votes} + onVote(suggestion.id, false)} + > + + + + + + + {suggestion.title} + {suggestion.status === 'complété' && ( + + Complété + + )} + + {suggestion.description} + + {suggestion.author} + {suggestion.date} + + + + + ); +} \ No newline at end of file diff --git a/src/pages/suggestiontool b/src/pages/suggestiontool.tsx similarity index 100% rename from src/pages/suggestiontool rename to src/pages/suggestiontool.tsx
{suggestion.description}