unfile
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
import type { Person } from "@/new/photos/services/ml/cgroups";
|
||||
import OverflowMenu from "@ente/shared/components/OverflowMenu/menu";
|
||||
import { OverflowMenuOption } from "@ente/shared/components/OverflowMenu/option";
|
||||
import EditIcon from "@mui/icons-material/Edit";
|
||||
import MoreHoriz from "@mui/icons-material/MoreHoriz";
|
||||
import { t } from "i18next";
|
||||
import React from "react";
|
||||
import { SpaceBetweenFlex } from "../mui-custom";
|
||||
import { GalleryItemsHeaderAdapter, GalleryItemsSummary } from "./ListHeader";
|
||||
|
||||
interface PeopleListHeaderProps {
|
||||
person: Person;
|
||||
}
|
||||
|
||||
export const PersonListHeader: React.FC<PeopleListHeaderProps> = ({
|
||||
person,
|
||||
}) => {
|
||||
const hasOptions = process.env.NEXT_PUBLIC_ENTE_WIP_CL;
|
||||
return (
|
||||
<GalleryItemsHeaderAdapter>
|
||||
<SpaceBetweenFlex>
|
||||
<GalleryItemsSummary
|
||||
name={person.name ?? "Unnamed person"}
|
||||
fileCount={person.fileIDs.length}
|
||||
/>
|
||||
{hasOptions && (
|
||||
<OverflowMenu
|
||||
ariaControls={"person-options"}
|
||||
triggerButtonIcon={<MoreHoriz />}
|
||||
>
|
||||
<OverflowMenuOption
|
||||
startIcon={<EditIcon />}
|
||||
onClick={() => console.log("test")}
|
||||
>
|
||||
{t("download_album")}
|
||||
</OverflowMenuOption>
|
||||
</OverflowMenu>
|
||||
)}
|
||||
</SpaceBetweenFlex>
|
||||
</GalleryItemsHeaderAdapter>
|
||||
);
|
||||
};
|
||||
@@ -1,14 +1,22 @@
|
||||
/**
|
||||
* @file code that really belongs to pages/gallery.tsx itself, but written here
|
||||
* in a separate file so that we can write in this package that has TypeScript
|
||||
* strict mode enabled. Once the original gallery.tsx is strict mode, this code
|
||||
* can be inlined back there.
|
||||
* @file code that really belongs to pages/gallery.tsx itself (or related
|
||||
* files), but it written here in a separate file so that we can write in this
|
||||
* package that has TypeScript strict mode enabled.
|
||||
*
|
||||
* Once the original gallery.tsx is strict mode, this code can be inlined back
|
||||
* there.
|
||||
*/
|
||||
|
||||
import type { Person } from "@/new/photos/services/ml/cgroups";
|
||||
import type { SearchOption } from "@/new/photos/services/search/types";
|
||||
import OverflowMenu from "@ente/shared/components/OverflowMenu/menu";
|
||||
import { OverflowMenuOption } from "@ente/shared/components/OverflowMenu/option";
|
||||
import EditIcon from "@mui/icons-material/Edit";
|
||||
import MoreHoriz from "@mui/icons-material/MoreHoriz";
|
||||
import { Typography } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import React from "react";
|
||||
import { SpaceBetweenFlex } from "../mui-custom";
|
||||
import { GalleryItemsHeaderAdapter, GalleryItemsSummary } from "./ListHeader";
|
||||
|
||||
interface SearchResultsHeaderProps {
|
||||
@@ -28,3 +36,36 @@ export const SearchResultsHeader: React.FC<SearchResultsHeaderProps> = ({
|
||||
/>
|
||||
</GalleryItemsHeaderAdapter>
|
||||
);
|
||||
|
||||
interface PeopleListHeaderProps {
|
||||
person: Person;
|
||||
}
|
||||
|
||||
export const PersonListHeader: React.FC<PeopleListHeaderProps> = ({
|
||||
person,
|
||||
}) => {
|
||||
const hasOptions = process.env.NEXT_PUBLIC_ENTE_WIP_CL;
|
||||
return (
|
||||
<GalleryItemsHeaderAdapter>
|
||||
<SpaceBetweenFlex>
|
||||
<GalleryItemsSummary
|
||||
name={person.name ?? "Unnamed person"}
|
||||
fileCount={person.fileIDs.length}
|
||||
/>
|
||||
{hasOptions && (
|
||||
<OverflowMenu
|
||||
ariaControls={"person-options"}
|
||||
triggerButtonIcon={<MoreHoriz />}
|
||||
>
|
||||
<OverflowMenuOption
|
||||
startIcon={<EditIcon />}
|
||||
onClick={() => console.log("test")}
|
||||
>
|
||||
{t("download_album")}
|
||||
</OverflowMenuOption>
|
||||
</OverflowMenu>
|
||||
)}
|
||||
</SpaceBetweenFlex>
|
||||
</GalleryItemsHeaderAdapter>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user