import * as React from 'react';

import { cn } from '@workspace/ui/lib/utils';
import { Button } from '@workspace/ui/components/ui/button';

export interface FinalCTASectionProps extends React.HTMLAttributes<HTMLDivElement> {
  title: string;
  description: string;
  primaryCtaText: string;
  primaryCtaHref: string;
  secondaryCtaText?: string;
  secondaryCtaHref?: string;
}

export function FinalCTASection({
  title,
  description,
  primaryCtaText,
  primaryCtaHref,
  secondaryCtaText,
  secondaryCtaHref,
  className,
  ...props
}: FinalCTASectionProps) {
  return (
    <div
      className={cn(
        "flex flex-col items-center justify-center text-center p-8 md:p-12 rounded-lg border bg-card",
        className
      )}
      {...props}
    >
      <h2 className="text-2xl font-bold">{title}</h2>
      <p className="mt-2 text-muted-foreground max-w-xl">
        {description}
      </p>
      <div className="mt-6 flex flex-col sm:flex-row gap-3">
        <Button asChild size="lg">
          <a href={primaryCtaHref}>{primaryCtaText}</a>
        </Button>
        {secondaryCtaText && secondaryCtaHref && (
          <Button asChild variant="outline" size="lg">
            <a href={secondaryCtaHref}>{secondaryCtaText}</a>
          </Button>
        )}
      </div>
    </div>
  );
}