feat(help): add Help Center with video tutorials and progress tracking

- Implemented Help Center page with video categories and tutorials.
- Added VideoModal component for video playback.
- Introduced progress tracking for watched videos using local storage.
- Created CSS styles for Help Center layout and components.
- Added video data structure and sample videos for various categories.
- Updated Footer to include a link to the Help Center.
This commit is contained in:
2026-09-02 09:46:02 -03:00
parent 48ed64eb87
commit c5217aa7c8
8 changed files with 1400 additions and 0 deletions
+317
View File
@@ -0,0 +1,317 @@
"use client";
import { useState, useEffect } from "react";
import style from "./help.module.css";
import { videoCategories, Video, getTotalVideoCount } from "./videoData";
import VideoModal from "./components/VideoModal";
import AnimatedContainer from "@core/app/components/AnimatedConainer/AnimatedContainer";
import HeaderConfProvider from "@core/app/components/HeaderConfProvider/HeaderConfProvider";
import DefaultLoginAction from "@core/app/components/LoginAction/DefaultLoginAction";
import { ScrollToTop } from "@core/app/components/ScrollTop";
import Link from "next/link";
export default function HelpPage() {
const [selectedVideo, setSelectedVideo] = useState<Video | null>(null);
const [isModalOpen, setIsModalOpen] = useState(false);
const [activeCategory, setActiveCategory] = useState<string>("all");
const [watchedVideos, setWatchedVideos] = useState<Set<string>>(new Set());
const totalVideos = getTotalVideoCount();
useEffect(() => {
const watched = localStorage.getItem("tx-help-watched");
if (watched) {
setWatchedVideos(new Set(JSON.parse(watched)));
}
}, []);
const handleVideoClick = (video: Video) => {
setSelectedVideo(video);
setIsModalOpen(true);
const newWatched = new Set(watchedVideos);
newWatched.add(video.id);
setWatchedVideos(newWatched);
localStorage.setItem("tx-help-watched", JSON.stringify([...newWatched]));
};
const handleCloseModal = () => {
setIsModalOpen(false);
setTimeout(() => setSelectedVideo(null), 200);
};
const handleCategoryClick = (categoryId: string) => {
setActiveCategory(categoryId);
if (categoryId !== "all") {
const element = document.getElementById(`category-${categoryId}`);
if (element) {
element.scrollIntoView({ behavior: "smooth", block: "start" });
}
}
};
const progressPercent = Math.round((watchedVideos.size / totalVideos) * 100);
return (
<AnimatedContainer
color="#aeaeae"
minSize={150}
maxSize={500}
items={10}
style={{
display: "block",
width: "100%",
background: "var(--white)",
}}
>
<ScrollToTop />
<HeaderConfProvider />
<DefaultLoginAction />
<div className={style.container}>
{/* Hero Section */}
<div className={style.hero}>
<div className={style.heroIcon}>
<svg
width="36"
height="36"
viewBox="0 0 24 24"
fill="none"
stroke="white"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<polygon points="5 3 19 12 5 21 5 3" />
</svg>
</div>
<h1 className={style.heroTitle}>Centro de Ayuda</h1>
<p className={style.heroSubtitle}>
Aprende a usar TurnosXpress paso a paso con nuestros tutoriales en video.
Desde la configuración inicial hasta las funciones más avanzadas,
tenemos todo lo que necesitas para aprovechar al máximo la plataforma.
</p>
<div className={style.heroStats}>
<div className={style.statItem}>
<span className={style.statNumber}>{totalVideos}</span>
<span className={style.statLabel}>Video tutoriales</span>
</div>
<div className={style.statItem}>
<span className={style.statNumber}>{videoCategories.length}</span>
<span className={style.statLabel}>Categorías</span>
</div>
<div className={style.statItem}>
<span className={style.statNumber}>{watchedVideos.size}</span>
<span className={style.statLabel}>Vistos</span>
</div>
</div>
</div>
{/* Progress Section */}
{watchedVideos.size > 0 && (
<div className={style.progressSection}>
<h2 className={style.progressTitle}>
Tu progreso de aprendizaje
</h2>
<p className={style.progressText}>
Has visto {watchedVideos.size} de {totalVideos} tutoriales.
{progressPercent === 100
? " ¡Felicidades! Has completado todos los tutoriales."
: ` ¡Sigue así, te faltan ${totalVideos - watchedVideos.size}!`}
</p>
<div className={style.progressBar}>
<div
className={style.progressFill}
style={{ width: `${progressPercent}%` }}
/>
</div>
</div>
)}
{/* Category Navigation */}
<div className={style.categoryNav}>
<button
className={
activeCategory === "all"
? style.categoryBtnActive
: style.categoryBtn
}
onClick={() => {
setActiveCategory("all");
window.scrollTo({ top: 0, behavior: "smooth" });
}}
>
Todos
</button>
{videoCategories.map((cat) => (
<button
key={cat.id}
className={
activeCategory === cat.id
? style.categoryBtnActive
: style.categoryBtn
}
onClick={() => handleCategoryClick(cat.id)}
>
{cat.icon} {cat.name}
</button>
))}
</div>
{/* Learning Path */}
<div className={style.learningPath}>
<span className={style.learningPathIcon}>
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<circle cx="12" cy="12" r="10" />
<path d="M12 16v-4" />
<path d="M12 8h.01" />
</svg>
</span>
<span className={style.learningPathText}>
<strong>Recomendación:</strong> Sigue el orden de las categorías para
un aprendizaje progresivo. Comienza con &quot;Primeros Pasos&quot; y
avanza según tus necesidades.
</span>
</div>
{/* Video Categories */}
{videoCategories.map((category) => (
<div
key={category.id}
id={`category-${category.id}`}
className={style.categorySection}
>
<div className={style.categoryHeader}>
<div
className={style.categoryIcon}
style={{ background: category.color }}
>
<span style={{ fontSize: "1.5rem" }}>{category.icon}</span>
</div>
<div>
<h2 className={style.categoryTitle}>{category.name}</h2>
<p className={style.categoryDescription}>
{category.description}
</p>
</div>
<span className={style.categoryCount}>
{category.videos.length} videos
</span>
</div>
<div className={style.videoGrid}>
{category.videos.map((video, idx) => (
<div
key={video.id}
className={style.videoCard}
onClick={() => handleVideoClick(video)}
>
<div className={style.videoThumbnail}>
<img
src={video.thumbnail}
alt={video.title}
loading="lazy"
/>
<div className={style.playOverlay}>
<div className={style.playButton}>
<div className={style.playIcon} />
</div>
</div>
{watchedVideos.has(video.id) && (
<div
style={{
position: "absolute",
top: "8px",
left: "8px",
background:
"linear-gradient(135deg, #2aaa2a, #008011)",
color: "white",
padding: "3px 8px",
borderRadius: "4px",
fontSize: "0.7rem",
fontWeight: 700,
display: "flex",
alignItems: "center",
gap: "3px",
}}
>
✓ Visto
</div>
)}
</div>
<div className={style.videoContent}>
<h3 className={style.videoTitle}>{video.title}</h3>
<p className={style.videoDescription}>
{video.description}
</p>
<div className={style.videoMeta}>
<div className={style.videoStep}>
<span className={style.stepNumber}>
{idx + 1}
</span>
Paso {idx + 1} de {category.videos.length}
</div>
</div>
</div>
</div>
))}
</div>
</div>
))}
{/* CTA Section */}
<div className={style.ctaSection}>
<h2 className={style.ctaTitle}>¿Necesitas más ayuda?</h2>
<p className={style.ctaText}>
Si no encontrás lo que buscás, nuestro equipo de soporte está
listo para ayudarte. También podés visitar nuestro canal de YouTube
para más contenido.
</p>
<div style={{ display: "flex", gap: "1rem", justifyContent: "center", flexWrap: "wrap" }}>
<a
href="mailto:info@turnosxpress.com.ar"
className={style.ctaButton}
>
✉ Escribinos
</a>
<a
href="https://www.youtube.com/@turnosxpress"
target="_blank"
rel="noopener noreferrer"
className={style.ctaButton}
style={{
background: "var(--white)",
color: "var(--wine-darkest)",
boxShadow: "0 4px 15px rgba(0,0,0,0.1)",
}}
>
▶ Canal de YouTube
</a>
</div>
</div>
</div>
{/* Video Modal */}
<VideoModal
video={selectedVideo}
isOpen={isModalOpen}
onClose={handleCloseModal}
onSelectVideo={(video) => {
setSelectedVideo(video);
const newWatched = new Set(watchedVideos);
newWatched.add(video.id);
setWatchedVideos(newWatched);
localStorage.setItem("tx-help-watched", JSON.stringify([...newWatched]));
}}
/>
</AnimatedContainer>
);
}