|
1 | 1 | import React from 'react';
|
2 | 2 |
|
3 |
| -export default function DocsLinkCard({items, colSize}) { |
4 |
| - let colClasses = "lg:tw-grid-cols-2 tw-gap-4 xs:tw-grid-cols-1 "; |
5 |
| - if (colSize === "lg") { |
6 |
| - colClasses = "lg:tw-grid-cols-4 tw-gap-2 xs:tw-grid-cols-2" |
7 |
| - }else if (colSize === "md") { |
8 |
| - colClasses = "lg:tw-grid-cols-3 tw-gap-2 xs:tw-grid-cols-1 md:tw-grid-cols-2" |
9 |
| - } |
10 |
| - return ( |
11 |
| - <div className={`tw-grid ${colClasses}`}> |
12 |
| - {items.map((item) => ( |
13 |
| - <div |
14 |
| - key={item.title} |
15 |
| - className="tw-relative tw-flex tw-items-center tw-space-x-3 tw-rounded-lg tw-border tw-border-solid tw-border-primary-500 tw-bg-white tw-px-6 tw-py-5 tw-shadow-sm focus-within:tw-ring-2 focus-within:tw-ring-indigo-500 focus-within:tw-ring-offset-2 hover:tw-border-primary-600 hover:tw-shadow-md" |
16 |
| - > |
17 |
| - {item.icon && |
18 |
| - <div className="tw-flex-shrink-0"> |
19 |
| - <img width="40px" className="tw-max-h-10 tw-max-w-10" src={item.icon} alt=""/> |
20 |
| - </div> |
21 |
| - } |
22 |
| - <div className="tw-min-w-0 tw-flex-1"> |
23 |
| - <a href={item.url} className="focus:tw-outline-none hover:tw-no-underline"> |
24 |
| - <span className="tw-absolute tw-inset-0" aria-hidden="true"/> |
25 |
| - <div className="tw-text-md tw-font-medium tw-text-gray-900 tw-break-keep">{item.title}</div> |
26 |
| - {item.description && |
27 |
| - <div className="tw-text-sm tw-text-gray-500">{item.description}</div> |
28 |
| - } |
29 |
| - </a> |
30 |
| - </div> |
31 |
| - </div> |
32 |
| - ))} |
| 3 | +export default function DocsLinkCard({ items, colSize }) { |
| 4 | + let colClasses = "lg:tw-grid-cols-2 tw-gap-4 xs:tw-grid-cols-1 "; |
| 5 | + if (colSize === "lg") { |
| 6 | + colClasses = "lg:tw-grid-cols-4 tw-gap-2 xs:tw-grid-cols-2" |
| 7 | + } else if (colSize === "md") { |
| 8 | + colClasses = "lg:tw-grid-cols-3 tw-gap-2 xs:tw-grid-cols-1 md:tw-grid-cols-2" |
| 9 | + } |
| 10 | + return ( |
| 11 | + <div className={`tw-grid ${colClasses}`}> |
| 12 | + {items.map((item) => ( |
| 13 | + <div |
| 14 | + key={item.title} |
| 15 | + className="tw-relative tw-flex tw-items-center tw-space-x-3 tw-rounded-lg tw-border tw-border-solid tw-border-primary-500 tw-bg-white tw-px-6 tw-py-5 tw-shadow-sm focus-within:tw-ring-2 focus-within:tw-ring-indigo-500 focus-within:tw-ring-offset-2 hover:tw-border-primary-600 hover:tw-shadow-md" |
| 16 | + > |
| 17 | + {item.icon && |
| 18 | + <div className="tw-flex-shrink-0"> |
| 19 | + <img width="40px" className="tw-max-h-10 tw-max-w-10" src={item.icon} alt="" /> |
| 20 | + </div> |
| 21 | + } |
| 22 | + <div className="tw-min-w-0 tw-flex-1"> |
| 23 | + <a href={item.url} className="focus:tw-outline-none hover:tw-no-underline"> |
| 24 | + <span className="tw-absolute tw-inset-0" aria-hidden="true" /> |
| 25 | + <div className="tw-text-md tw-font-medium tw-text-gray-900 tw-break-keep">{item.title}</div> |
| 26 | + {item.description && |
| 27 | + <div className="tw-text-sm tw-text-gray-500">{item.description}</div> |
| 28 | + } |
| 29 | + </a> |
| 30 | + </div> |
33 | 31 | </div>
|
34 |
| - ) |
| 32 | + ))} |
| 33 | + </div> |
| 34 | + ) |
35 | 35 | }
|
0 commit comments