import type { ReactNode } from 'react';
import { Button } from 'cloudrite';
import { ArrowRight, Download, Loader2, Phone, Trash2 } from 'lucide-react';

// Cloudrite is a dark-only design system: `ghost`, `link` and `outline` are all
// foreground-coloured, so they vanish on the preview harness's white card body.
// Every story renders on the brand surface — which is also how a real screen is
// built (see the README's conventions section).
const Surface = ({ children }: { children: ReactNode }) => (
  <div className="bg-background text-foreground rounded-lg p-6">{children}</div>
);

export const Variants = () => (
  <Surface>
    <div className="flex flex-wrap items-center gap-3">
      <Button>Get a quote</Button>
      <Button variant="secondary">Learn more</Button>
      <Button variant="outline">View services</Button>
      <Button variant="ghost">Cancel</Button>
      <Button variant="link">Read the case study</Button>
      <Button variant="destructive">Delete site</Button>
    </div>
  </Surface>
);

export const Sizes = () => (
  <Surface>
    <div className="flex flex-wrap items-center gap-3">
      <Button size="sm">Small</Button>
      <Button size="default">Default</Button>
      <Button size="lg">Large</Button>
      <Button size="icon" aria-label="Download invoice">
        <Download />
      </Button>
    </div>
  </Surface>
);

export const WithIcons = () => (
  <Surface>
    <div className="flex flex-wrap items-center gap-3">
      <Button>
        Book a callout
        <ArrowRight />
      </Button>
      <Button variant="outline">
        <Phone />
        021 107 7483
      </Button>
      <Button variant="destructive">
        <Trash2 />
        Remove backup
      </Button>
    </div>
  </Surface>
);

export const States = () => (
  <Surface>
    <div className="flex flex-wrap items-center gap-3">
      <Button disabled>Disabled</Button>
      <Button variant="outline" disabled>
        Disabled outline
      </Button>
      <Button disabled>
        <Loader2 className="animate-spin" />
        Provisioning…
      </Button>
    </div>
  </Surface>
);
