'use client';
import logger from '@/utils/logger';
import React, { useState } from 'react';

export default function AnnouncementScheduler({ csrfToken }) {
  const [title, setTitle] = useState('');
  const [date, setDate] = useState('');
  const [message, setMessage] = useState('');

  const handleSchedule = () => {
    // Logique pour planifier une annonce
    logger.debug('Annonce planifiée:', { title, date, message });
  };

  return (
    <div className="p-4 bg-white rounded shadow">
      <h2 className="font-headline text-xl font-bold mb-4">Planifier une Annonce</h2>
      <div className="mb-4">
        <label className="block font-medium">Titre</label>
        <input
          type="text"
          value={title}
          onChange={(e) => setTitle(e.target.value)}
          className="w-full p-2 border rounded"
        />
      </div>
      <div className="mb-4">
        <label className="block font-medium">Date</label>
        <input
          type="date"
          value={date}
          onChange={(e) => setDate(e.target.value)}
          className="w-full p-2 border rounded"
        />
      </div>
      <div className="mb-4">
        <label className="block font-medium">Message</label>
        <textarea
          value={message}
          onChange={(e) => setMessage(e.target.value)}
          className="w-full p-2 border rounded"
          rows="5"
        />
      </div>
      <button
        onClick={handleSchedule}
        className="bg-blue-500 text-white px-4 py-2 rounded"
      >
        Planifier
      </button>
    </div>
  );
}
