"use client";

import * as React from "react";

import { Button } from "@/components/ui/button";
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
} from "@/components/ui/dialog";

type WelcomeDialogProps = {
  open: boolean;
  onStart: () => void;
  onSkip: () => void;
  onSkipForever: () => void;
};

export function TutorialWelcomeDialog({
  open,
  onStart,
  onSkip,
  onSkipForever,
}: WelcomeDialogProps) {
  return (
    <Dialog open={open} onOpenChange={(next) => (!next ? onSkip() : undefined)}>
      <DialogContent className="sm:max-w-md" showCloseButton={false}>
        <DialogHeader>
          <DialogTitle>Welcome to your portal</DialogTitle>
          <DialogDescription>
            A short interactive tour shows where things live, then you can try a
            guided task — run a report, add a transaction, or configure settings.
            You can reopen this anytime from Help.
          </DialogDescription>
        </DialogHeader>
        <DialogFooter className="gap-2 sm:justify-between">
          <Button type="button" variant="ghost" onClick={onSkipForever}>
            Don&apos;t show again
          </Button>
          <div className="flex gap-2">
            <Button type="button" variant="outline" onClick={onSkip}>
              Skip
            </Button>
            <Button type="button" onClick={onStart}>
              Start tour
            </Button>
          </div>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}
