import React from 'react'
import { Card } from 'flowbite-react'
import { LuRefreshCw, LuUndo } from 'react-icons/lu'

interface BookingPoliciesProps {
  refundable: boolean
  reschedulable: boolean
  onRefundableChange: (value: boolean) => void
  onReschedulableChange: (value: boolean) => void
}

export default function BookingPolicies({
  refundable,
  reschedulable,
  onRefundableChange,
  onReschedulableChange,
}: BookingPoliciesProps) {
  return (
    <Card className="border-slate-200 shadow-none">
      <div className="mb-6">
        <h3 className="text-xl font-semibold text-slate-900 mb-2">
          Booking Policies
        </h3>
        <p className="text-sm text-slate-600">
          Configure cancellation and reschedule policies for this booking.
        </p>
      </div>

      <div className="space-y-4">
        {/* Refundable Policy */}
        <div className="flex items-start space-x-3">
          <input
            id="refundable"
            type="checkbox"
            checked={refundable}
            onChange={(e) => onRefundableChange(e.target.checked)}
            className="mt-1 h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
          />
          <div className="flex-1">
            <label
              htmlFor="refundable"
              className="flex items-center gap-2 cursor-pointer"
            >
              <div className="w-8 h-8 bg-red-50 rounded-full flex items-center justify-center">
                <LuUndo className="w-4 h-4 text-red-600" />
              </div>
              <div>
                <span className="font-medium text-slate-900">Refundable</span>
              </div>
            </label>
            <p className="text-sm text-slate-500 mt-1 ml-10">
              Allow cancellation and refund for this booking according to the
              cancellation policy.
            </p>
          </div>
        </div>

        {/* Reschedulable Policy */}
        <div className="flex items-start space-x-3">
          <input
            id="reschedulable"
            type="checkbox"
            checked={reschedulable}
            onChange={(e) => onReschedulableChange(e.target.checked)}
            className="mt-1 h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
          />
          <div className="flex-1">
            <label
              htmlFor="reschedulable"
              className="flex items-center gap-2 cursor-pointer"
            >
              <div className="w-8 h-8 bg-blue-50 rounded-full flex items-center justify-center">
                <LuRefreshCw className="w-4 h-4 text-blue-600" />
              </div>
              <div>
                <span className="font-medium text-slate-900">
                  Reschedulable
                </span>
              </div>
            </label>
            <p className="text-sm text-slate-500 mt-1 ml-10">
              Allow date changes for this booking according to the reschedule
              policy.
            </p>
          </div>
        </div>
      </div>
    </Card>
  )
}
