import {
Box,
Flex,
FormControl,
FormHelperText,
FormLabel,
HTMLChakraProps,
Heading,
Input,
LinkBox,
LinkOverlay,
Tab,
TabList,
TabPanel,
TabPanels,
Tabs,
Text,
chakra,
} from '@chakra-ui/react'
import { useFormik } from 'formik'
import NextLink from 'next/link'
import * as React from 'react'
import { FaMicrophone, FaPenSquare, FaVideo } from 'react-icons/fa'
import Masonry, { ResponsiveMasonry } from 'react-responsive-masonry'
import PageContainer from 'components/page-container'
import ResourceCard, { Resource } from 'components/resource-card'
import Sidebar from 'components/sidebar/sidebar'
import resources from 'configs/resources.json'
import { getRoutes } from 'layouts/mdx'
import { filterResources } from 'utils/filter-resources'
import { t } from 'utils/i18n'
import { groupBy } from 'utils/js-utils'
function Resources() {
/**
* Re-use the docs sidebar so it's easier for a visitors
* to reference components mentioned in the resource blog/video.
*/
const routes = getRoutes('/docs/')
const data = resources.data as Resource[]
const groups = groupBy(data, 'type')
const BLOGS = t('resources.blogs.title')
const TALKS = t('resources.talks.title')
const VIDEOS = t('resources.videos.title')
return (
}
frontmatter={{
title: t('resources.title'),
description: t('resources.description'),
}}
>
{t('resources.message')}
)
}
export default Resources
interface ResourceSectionProps {
title: string
resources: Resource[]
}
function ResourceSection(props: ResourceSectionProps) {
const { title, resources } = props
const filterInputId = `resources-filter-${title.toLowerCase()}`
const formik = useFormik({
initialValues: { [filterInputId]: '' },
onSubmit: undefined,
})
const filteredResources = filterResources(
formik.values[filterInputId],
resources,
)
/**
* Notice, that the breakpoints don't follow conventional numbers (e.g. 768, 991).
* The reason for that is that the number (e.g. 767) actually represents target
* number - 1 (e.g. 768 - 1), where at target number (e.g. 768) is the point at
* which the grid should switch. This might be a bug with the library.
*/
const masonryGridBreakpoints = { 350: 1, 580: 2, 767: 1, 990: 2 }
return (
{t('resources.searchFilter.label')}
{t('resources.searchFilter.helperText')}
{filteredResources.map((item, index) => (
))}
)
}
interface ResourcesTabContentProps {
icon: React.ElementType
text: string
}
function ResourcesTabContent({ icon, text }: ResourcesTabContentProps) {
return (
<>
{text}
>
)
}
const ShowcaseIcon = (props: HTMLChakraProps<'svg'>) => (
)
const ShowcaseBanner = () => (
{t('resources.showcaseBannerTitle')}
{t('resources.showcaseBannerDescription')}
)