2021-12-22 06:42:57 -08:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { Showcase } from '../../../utils/apiTypes';
|
2021-12-22 23:05:23 -08:00
|
|
|
import { Card, PlaceholderCard } from './Card';
|
2021-12-22 06:42:57 -08:00
|
|
|
|
|
|
|
interface NetworkSectionProps {
|
|
|
|
title: string;
|
|
|
|
icon?: JSX.Element;
|
|
|
|
iconColor?: string;
|
|
|
|
networks?: Showcase[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export const NetworkSection = ({
|
|
|
|
title,
|
|
|
|
icon,
|
|
|
|
iconColor,
|
|
|
|
networks,
|
|
|
|
}: NetworkSectionProps): JSX.Element => {
|
|
|
|
return (
|
2022-04-01 06:34:49 -07:00
|
|
|
<div className="margin-top--lg container">
|
2021-12-22 06:42:57 -08:00
|
|
|
<div
|
|
|
|
className="margin-bottom--sm"
|
|
|
|
style={{
|
2022-04-01 06:34:49 -07:00
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
2021-12-22 06:42:57 -08:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
<h2>{title}</h2>
|
|
|
|
{icon && (
|
|
|
|
<span
|
|
|
|
style={{
|
2022-04-01 06:34:49 -07:00
|
|
|
marginBottom: '0.5rem',
|
|
|
|
marginLeft: '0.5rem',
|
|
|
|
fontSize: '1.25rem',
|
|
|
|
lineHeight: '1.75rem',
|
2021-12-22 06:42:57 -08:00
|
|
|
color: iconColor,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{icon}
|
|
|
|
</span>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
<ul
|
|
|
|
style={{
|
2022-04-01 06:34:49 -07:00
|
|
|
position: 'relative',
|
|
|
|
display: 'grid',
|
|
|
|
gap: '1.5rem',
|
|
|
|
gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))',
|
|
|
|
paddingLeft: '0',
|
2021-12-22 06:42:57 -08:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
{networks ? (
|
|
|
|
<>
|
|
|
|
{networks.map((network) => (
|
|
|
|
<Card key={network.title} network={network} />
|
|
|
|
))}
|
|
|
|
{networks.length === 0 && <h2>No result</h2>}
|
|
|
|
</>
|
|
|
|
) : (
|
2021-12-22 23:05:23 -08:00
|
|
|
<div>
|
|
|
|
<PlaceholderCard />
|
|
|
|
</div>
|
2021-12-22 06:42:57 -08:00
|
|
|
)}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|