import { X } from 'lucide-react'; import { useOnborda, type CardComponentProps } from 'onborda'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'; import { useTranslation } from '@/i18n/useI18n'; export const TourCard = ({ step, currentStep, totalSteps, nextStep, prevStep, arrow, }: CardComponentProps) => { const { t } = useTranslation(); const { closeOnborda } = useOnborda(); const isFirst = currentStep === 0; const isLast = currentStep === totalSteps - 1; const handleClose = () => { localStorage.setItem('chat_tour_done', '1'); closeOnborda(); }; const handleNext = () => { if (isLast) { handleClose(); return; } nextStep(); }; return ( <> {/* Arrow inherits color via `currentColor`; force it to the card's background so the triangle visually merges with the card. */} {arrow} {step.title} {step.content} {t('tour.step', { current: currentStep + 1, total: totalSteps })}
{!isFirst && ( )}
); };