Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

GuideCards.tsx 1.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  1. import { useRouter } from 'next/router'
  2. import { Link } from 'components/Link'
  3. import { ArrowRightIcon } from '@primer/octicons-react'
  4. import { useMainContext } from 'components/context/MainContext'
  5. import { useProductLandingContext } from 'components/context/ProductLandingContext'
  6. import { GuideCard } from 'components/landing/GuideCard'
  7. export const GuideCards = () => {
  8. const router = useRouter()
  9. const { currentCategory } = useMainContext()
  10. const { guideCards } = useProductLandingContext()
  11. const routePath = `/${router.locale}${router.asPath.split('?')[0]}` // remove query string
  12. if (!guideCards) {
  13. return null
  14. }
  15. return (
  16. <div>
  17. <div className="d-lg-flex gutter-lg flex-items-stretch">
  18. {(guideCards || []).map((guide) => {
  19. return <GuideCard key={guide.href} guide={guide} />
  20. })}
  21. </div>
  22. {!currentCategory && (
  23. <Link href={`${routePath}/guides`} className="btn btn-outline float-right">
  24. Explore guides <ArrowRightIcon />
  25. </Link>
  26. )}
  27. </div>
  28. )
  29. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...