Skip to content
Snippets Groups Projects
Profile.js 1.19 KiB
Newer Older
Tarje Lavik's avatar
Tarje Lavik committed
import Image from 'next/image'
import { Box, Heading, Text } from '@chakra-ui/react'
import React from 'react'
import PortableTextBlock from '../../PT/PortableTextBlock'
import { kebabCase } from 'lodash'
import Link from '../../Link'
Tarje Lavik's avatar
Tarje Lavik committed
import { getNextSanityImage } from '../../../lib/sanity.server'
export default function Profile({ data }) {
    <>
      {data.map((item) => (
        <React.Fragment key={item.item._id}>
Tarje Lavik's avatar
Tarje Lavik committed
            <Box mb="5" mt="26">
              <Image {...getNextSanityImage(item.image)} alt={item.label.no} layout="responsive" />
            </Box>

          <Heading
            id={kebabCase(item.label)}
            as="h3"
Tarje.Lavik's avatar
Tarje.Lavik committed
            maxW={['xl', null, '2xl', null]}
            mx="auto"
            fontSize={['xl', '2xl', '3xl', null]}
          >
            <Link href={`/id/${item.item._id}`}>{item.label}</Link>
          </Heading>

          {item.item?.shortDescription && (
Tarje.Lavik's avatar
Tarje.Lavik committed
            <Text maxW={['xl', null, '2xl', null]} mx="auto">
              {item.item.shortDescription}
            </Text>
          )}
          <PortableTextBlock blocks={item.description} />
        </React.Fragment>