import Head from 'next/head'; import Link from 'next/link'; import prisma from '../lib/prisma'; import Shell from '../components/Shell'; import {getSession, useSession} from 'next-auth/client'; import {CheckIcon, ClockIcon, InformationCircleIcon} from '@heroicons/react/outline'; import DonateBanner from '../components/DonateBanner'; function classNames(...classes) { return classes.filter(Boolean).join(' ') } export default function Home(props) { const [session, loading] = useSession(); if (loading) { return
Loading...
; } function convertMinsToHrsMins(mins) { let h = Math.floor(mins / 60); let m = mins % 60; h = h < 10 ? '0' + h : h; m = m < 10 ? '0' + m : m; return `${h}:${m}`; } const stats = [ { name: 'Event Types', stat: props.eventTypeCount }, { name: 'Integrations', stat: props.integrationCount }, { name: 'Available Hours', stat: Math.round(((props.user.endTime - props.user.startTime) / 60) * 100) / 100 + ' hours' }, ]; let timeline = []; if (session) { timeline = [ { id: 1, content: 'Add your first', target: 'integration', href: '/integrations', icon: props.integrationCount != 0 ? CheckIcon : InformationCircleIcon, iconBackground: props.integrationCount != 0 ? 'bg-green-400' : 'bg-gray-400', }, { id: 2, content: 'Add one or more', target: 'event types', href: '/availability', icon: props.eventTypeCount != 0 ? CheckIcon : InformationCircleIcon, iconBackground: props.eventTypeCount != 0 ? 'bg-green-400' : 'bg-gray-400', }, { id: 3, content: 'Complete your', target: 'profile', href: '/settings/profile', icon: session.user.image ? CheckIcon : InformationCircleIcon, iconBackground: session.user.image ? 'bg-green-400' : 'bg-gray-400', }, ]; } else { timeline = []; } return ({type.title}
in {type.description}
{type.length} minutes
Steps you should take to get started with Calendso.
{event.content}{' '} {event.target}
Offering time slots between {convertMinsToHrsMins(props.user.startTime)} and {convertMinsToHrsMins(props.user.endTime)}
Office 365 / Outlook.com Calendar
} {integration.type == 'google_calendar' &&Google Calendar
} {integration.type == 'zoom_video' &&Zoom
} {integration.type.endsWith('_calendar') &&Calendar Integration
} {integration.type.endsWith('_video') &&Video Conferencing
}You haven't added any integrations.