'use client';
import { useIsDarkMode } from '@/lib/dark-mode';
import { cn } from '@/lib/utils';
import { AnimatePresence, motion } from 'framer-motion';
import { useEffect, useState } from 'react';
import { Button } from './ui/button';
type Frame = {
id: string;
label: string;
key: string;
Component: React.ComponentType;
};
function LivePreview() {
const isDark = useIsDarkMode();
const colorScheme = isDark ? 'dark' : 'light';
const [loaded, setLoaded] = useState(false);
useEffect(() => {
setLoaded(true);
}, []);
if (!loaded) {
return null;
}
return (
);
}
function Image({ src }: { src: string }) {
const isDark = useIsDarkMode();
const colorScheme = isDark ? 'dark' : 'light';
return (
);
}
export function HeroCarousel() {
const frames: Frame[] = [
{
id: 'overview',
key: 'overview',
label: 'Live preview',
Component: LivePreview,
},
{
id: 'analytics',
key: 'analytics',
label: 'Product analytics',
Component: () => ,
},
{
id: 'funnels',
key: 'funnels',
label: 'Funnels',
Component: () => ,
},
{
id: 'retention',
key: 'retention',
label: 'Retention',
Component: () => ,
},
// {
// id: 'profile',
// key: 'profile',
// label: 'Inspect profile',
// Component: () => ,
// },
];
const [activeFrames, setActiveFrames] = useState([frames[0]]);
const activeFrame = activeFrames[activeFrames.length - 1];
return (
{frames.map((frame) => (
))}
{activeFrames.slice(-1).map((frame) => (
))}
);
}