This commit is contained in:
Manav Rathi
2024-09-24 16:46:16 +05:30
parent e10613fa0f
commit a0df76c2c3
2 changed files with 14 additions and 2 deletions

View File

@@ -1,10 +1,18 @@
import { Box, Stack, styled, Typography } from "@mui/material";
import {
Box,
Stack,
styled,
Typography,
type TypographyProps,
} from "@mui/material";
import { t } from "i18next";
import React from "react";
interface GalleryItemsSummaryProps {
/** The name / title for the items that are being shown. */
name: string;
/** Extra props to pass to the Typography component that shows the name. */
nameProps?: TypographyProps;
/** The number of items being shown. */
fileCount: number;
/** An element (usually an icon) placed after the file count. */
@@ -17,12 +25,15 @@ interface GalleryItemsSummaryProps {
*/
export const GalleryItemsSummary: React.FC<GalleryItemsSummaryProps> = ({
name,
nameProps,
fileCount,
endIcon,
}) => {
return (
<div>
<Typography variant="h3">{name}</Typography>
<Typography variant="h3" {...(nameProps ?? {})}>
{name}
</Typography>
<Stack
direction="row"

View File

@@ -50,6 +50,7 @@ export const PersonListHeader: React.FC<PeopleListHeaderProps> = ({
<SpaceBetweenFlex>
<GalleryItemsSummary
name={person.name ?? "Unnamed person"}
nameProps={person.name ? {} : { color: "text.muted" }}
fileCount={person.fileIDs.length}
/>
{hasOptions && (