import { Music } from 'lucide-react' import { useTheme } from 'next-themes' import Link from 'next/link' import { useEffect, useState } from 'react' import { cn, IconDocumentation, IconMicSolid, IconProductHunt, IconYoutubeSolid } from 'ui' import { ExpandableVideo } from 'ui-patterns/ExpandableVideo' import { StepLink } from './data/lw15_data' export const LWSVG = (props: React.SVGProps) => { return ( ) } export const FifteenSVG = (props: React.SVGProps) => { return ( ) } export const LW15ThemeSwitcher = ({ className, ...props }: React.HTMLAttributes) => { const { resolvedTheme, setTheme } = useTheme() const isDarkMode = resolvedTheme?.includes('dark') return (
{' '} /
) } interface DayLink extends StepLink { className?: string } export const DayLink = ({ type, icon, text, href = '', className }: DayLink) => { const [isMounted, setIsMounted] = useState(false) useEffect(() => { setIsMounted(true) }, []) if (!isMounted) return null const linkTypes = { blog: { icon: IconDocumentation, text: 'Blog Post', }, docs: { icon: IconDocumentation, text: 'Docs', }, productHunt: { icon: IconProductHunt, text: 'Product Hunt', }, video: { icon: IconYoutubeSolid, text: 'Watch video', }, podcast: { icon: Music, text: 'Podcast', }, xSpace: { icon: IconMicSolid, text: 'X Space', }, } const isTargetBlank = () => { switch (type) { case 'productHunt': case 'xSpace': case 'docs': return true } } const Text = () => <>{text ?? linkTypes[type]?.text} const Component = type === 'video' ? 'div' : Link const Trigger = ({ component: Comp, ...props }: any) => ( ) if (type === 'video') return } /> return } export default { DayLink, }