|
| 1 | +import { CheckCircleIcon, CubeIcon, LightningBoltIcon } from '@heroicons/react/outline' |
| 2 | +import React from 'react' |
| 3 | + |
| 4 | +const features = [ |
| 5 | + { |
| 6 | + name: 'Optimize images at build time', |
| 7 | + description: |
| 8 | + 'Normally, to use `next/image` with `next export`, you need to use a cloud provider for image optimization. With this solution, however, you can optimize images at build time, eliminating the need for a cloud provider.', |
| 9 | + icon: CubeIcon, |
| 10 | + }, |
| 11 | + { |
| 12 | + name: 'All options for `next/image` available', |
| 13 | + description: |
| 14 | + 'There is no need to use any special components. Use `next/image` as usual, all its options are available.', |
| 15 | + icon: CheckCircleIcon, |
| 16 | + }, |
| 17 | + { |
| 18 | + name: "Using `sharp`, so it's fast.", |
| 19 | + description: |
| 20 | + 'It is fast because it uses `sharp` for image optimization. This is also the approach used in Next.js, which is much faster than other image processing libraries.', |
| 21 | + icon: LightningBoltIcon, |
| 22 | + }, |
| 23 | + { |
| 24 | + name: 'Cache prevents repeating the same optimization', |
| 25 | + description: 'It has an internal cache mechanism so that the same images are not optimized repeatedly.', |
| 26 | + icon: CubeIcon, |
| 27 | + }, |
| 28 | +] |
| 29 | + |
| 30 | +const Features = () => { |
| 31 | + return ( |
| 32 | + <div className="overflow-hidden bg-gray-50 py-10 dark:bg-gray-800"> |
| 33 | + <div className="relative mx-auto max-w-7xl py-12 px-4 sm:px-6 lg:px-8"> |
| 34 | + <svg |
| 35 | + className="absolute top-0 left-full -translate-x-1/2 -translate-y-3/4 transform lg:left-auto lg:right-full lg:translate-x-2/3 lg:translate-y-1/4" |
| 36 | + width={404} |
| 37 | + height={784} |
| 38 | + fill="none" |
| 39 | + viewBox="0 0 404 784" |
| 40 | + aria-hidden="true" |
| 41 | + > |
| 42 | + <defs> |
| 43 | + <pattern |
| 44 | + id="8b1b5f72-e944-4457-af67-0c6d15a99f38" |
| 45 | + x={0} |
| 46 | + y={0} |
| 47 | + width={20} |
| 48 | + height={20} |
| 49 | + patternUnits="userSpaceOnUse" |
| 50 | + > |
| 51 | + <rect x={0} y={0} width={4} height={4} className="text-gray-200 dark:text-gray-600" fill="currentColor" /> |
| 52 | + </pattern> |
| 53 | + </defs> |
| 54 | + <rect width={404} height={784} fill="url(#8b1b5f72-e944-4457-af67-0c6d15a99f38)" /> |
| 55 | + </svg> |
| 56 | + |
| 57 | + <div className="relative lg:grid lg:grid-cols-3 lg:gap-x-8"> |
| 58 | + <div className="lg:col-span-1"> |
| 59 | + <h2 className="text-3xl font-extrabold tracking-tight sm:text-4xl"> |
| 60 | + Evolve Next.js into a complete static site generator. |
| 61 | + </h2> |
| 62 | + </div> |
| 63 | + <dl className="mt-10 space-y-10 sm:grid sm:grid-cols-2 sm:gap-x-8 sm:gap-y-10 sm:space-y-0 lg:col-span-2 lg:mt-0"> |
| 64 | + {features.map((feature) => ( |
| 65 | + <div key={feature.name}> |
| 66 | + <dt> |
| 67 | + <div className="flex h-12 w-12 items-center justify-center rounded-md bg-indigo-500 text-white dark:bg-indigo-700"> |
| 68 | + <feature.icon className="h-6 w-6" aria-hidden="true" /> |
| 69 | + </div> |
| 70 | + <p className="mt-5 text-lg font-medium leading-6">{feature.name}</p> |
| 71 | + </dt> |
| 72 | + <dd className="mt-2 text-base text-gray-500 dark:text-gray-400">{feature.description}</dd> |
| 73 | + </div> |
| 74 | + ))} |
| 75 | + </dl> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + ) |
| 80 | +} |
| 81 | + |
| 82 | +export default Features |
0 commit comments