2026-10-16 00:27:06 +03:00
|
|
|
import * as React from "react";
|
|
|
|
|
import { FunctionComponent } from "react";
|
|
|
|
|
|
2026-10-16 10:21:46 +03:00
|
|
|
// A titled block of the home page; children are laid out as a grid of cards.
|
|
|
|
|
const HomeSection: FunctionComponent<{ title: string, subtitle: string, emptyText?: string }> = (props) => {
|
2026-10-16 00:27:06 +03:00
|
|
|
const isEmpty = React.Children.count(props.children) === 0;
|
|
|
|
|
return (
|
2026-10-16 10:21:46 +03:00
|
|
|
<>
|
|
|
|
|
<div className="sec"><h2>{props.title}</h2><span className="secmeta">{props.subtitle}</span></div>
|
|
|
|
|
{isEmpty && props.emptyText ? <p className="empty">{props.emptyText}</p> : <div className="grid">{props.children}</div>}
|
|
|
|
|
</>
|
2026-10-16 00:27:06 +03:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default HomeSection;
|