import { Box, Button, Text } from '@chakra-ui/react'; import { typography } from '@livekit/livekit-chakra-theme'; import type { NextPage } from 'next'; import { useRouter } from 'next/router'; import styles from '../styles/Home.module.css'; const Home: NextPage = () => { const router = useRouter(); const startMeeting = () => { router.push(`/rooms/${generateRoomId()}`); }; return (
LiveKit Meet
); }; export default Home; function generateRoomId(): string { return `${randomString(4)}-${randomString(4)}`; } function randomString(length: number): string { var result = ''; var characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for (var i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; }