import React from 'react';
import { labelDateReunion } from '../../utils/datesReunion';
export const INPUT = 'w-full p-3 bg-gray-50 rounded-xl border-0 focus:ring-2 focus:ring-aa-blue';
const STATUTS = {
proposee: ['À seconder', 'bg-yellow-100 text-yellow-700'],
secondee: ['Secondée', 'bg-blue-100 text-blue-700'],
rejetee: ['Rejetée', 'bg-red-100 text-red-700'],
};
export function boutonAction(actif) {
return `p-3 rounded-xl text-sm font-bold ${actif ? 'bg-aa-blue text-white' : 'bg-gray-50 text-gray-700'}`;
}
export function Card({ titre, children }) {
return
{titre}
{children};
}
export function Champ({ label, children }) {
return ;
}
export function SelectDate({ value, onChange, dates }) {
if (!dates.length) {
return Configurez le jour de réunion dans les paramètres du groupe.
;
}
return (
);
}
export function MembreSelect({ label, value, onChange, membres }) {
return (
);
}
export function DecisionItem({ p, membres, estExecutif, form, setForm, seconderPour, setSeconderPour, seconder, voter }) {
const [label, cls] = STATUTS[p.statut] || STATUTS.proposee;
const motif = (form.etant_donne_que || '').trim();
const decision = (form.groupe_a_decide_de || '').trim();
return (
{p.sujet}
{p.description &&
{p.description}
}
Proposée par {p.proposeur_prenom}{p.secondeur_prenom ? ` · Secondée par ${p.secondeur_prenom}` : ''}
{label}
{p.statut === 'proposee' && (
)}
{p.statut === 'secondee' && estExecutif && (
)}
);
}