NTP_V2/web/src/components/SectionTitle.tsx

16 lines
640 B
TypeScript

import type { ElementType } from 'react';
import { Typography } from '@mui/material';
/** Title of a section of a record page: icon, bold title and a thin rule (same look as the MetaForm sections). */
export function SectionTitle({ icon: Icon, title }: { icon: ElementType; title: string }) {
return (
<Typography
component="h2"
sx={{ display: 'flex', alignItems: 'center', gap: 1, m: 0, mb: 1.5, fontSize: 15, fontWeight: 700, lineHeight: 1.4, color: 'text.primary', pb: 0.75, borderBottom: 1, borderColor: 'divider' }}
>
<Icon sx={{ fontSize: 20, color: 'inherit' }} />
{title}
</Typography>
);
}