

import { CheckIcon } from "@buzzwaretech/propel/icons";

type Props = {
  isChecked: boolean;
  handleChange: (checked: boolean) => void;
};

export function MarketingConsent({ isChecked, handleChange }: Props) {
  return (
    <div className="flex items-center justify-center gap-1.5">
      <button
        type="button"
        onClick={() => handleChange(!isChecked)}
        className={`flex size-4 items-center justify-center rounded-sm border-2 ${
          isChecked ? "border-accent-strong bg-accent-primary" : "border-strong"
        }`}
      >
        {isChecked && <CheckIcon className="h-3 w-3 text-on-color" />}
      </button>
      <span className="text-13 text-tertiary">
        I agree to BuzzwareTech marketing communications
      </span>
    </div>
  );
}
