π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Simplify like album selector and remove unlike modal
Anand Baburajanb65015b0fc4e
diff --git a/web/packages/gallery/components/viewer/FileViewer.tsx b/web/packages/gallery/components/viewer/FileViewer.tsxindex 81b6df29b7..5a6d5a3cc8 100644--- a/web/packages/gallery/components/viewer/FileViewer.tsx+++ b/web/packages/gallery/components/viewer/FileViewer.tsx@@ -68,7 +68,6 @@ import {type ItemData,} from "./data-source";import { LikeAlbumSelectorModal } from "./LikeAlbumSelectorModal";-import { UnlikeAlbumSelectorModal } from "./UnlikeAlbumSelectorModal";import { LikesSidebar } from "./LikesSidebar";import {FileViewerPhotoSwipe,@@ -307,21 +306,6 @@ export type FileViewerProps = ModalVisibilityProps & {"collectionNameByID" | "onSelectCollection" | "onSelectPerson">;-// Mock albums data for the like album selector-// TODO: Replace with actual albums from props/context when API is available-const mockAlbumsForLike = [- { id: 1, name: "Camera" },- { id: 2, name: "Mindfulness" },- { id: 3, name: "Album8223" },- { id: 4, name: "Nature" },- { id: 5, name: "Travel 2024" },- { id: 6, name: "Family" },- { id: 7, name: "Vacation" },- { id: 8, name: "Memories" },- { id: 9, name: "Favorites" },- { id: 10, name: "Summer" },-];-/*** A PhotoSwipe based image, live photo and video viewer.*/@@ -420,8 +404,6 @@ export const FileViewer: React.FC<FileViewerProps> = ({Map<number, FileReaction[]>>(new Map());- const [openUnlikeAlbumSelector, setOpenUnlikeAlbumSelector] = useState(false);-// If `true`, then we need to trigger a pull from remote when we close.const [, setNeedsRemotePull] = useState(false);@@ -439,7 +421,6 @@ export const FileViewer: React.FC<FileViewerProps> = ({setOpenComments(false);setOpenLikes(false);setOpenLikeAlbumSelector(false);- setOpenUnlikeAlbumSelector(false);setOpenPublicLikeModal(false);// No need to `resetMoreMenuButtonOnMenuClose` since we're closing// anyway and it'll be removed from the DOM.@@ -506,28 +487,53 @@ export const FileViewer: React.FC<FileViewerProps> = ({if (isGalleryView) {// Gallery view+ const collectionIDs = fileNormalCollectionIDs?.get(fileId) ?? [];+if (reactions.length === 0) {- // Not liked in any collection - show album selector to add- setOpenLikeAlbumSelector(true);- } else if (reactions.length === 1) {- // Liked in exactly one collection - delete directly- const reaction = reactions[0]!;+ // Not liked in any collection+ if (collectionIDs.length === 1) {+ // Single album - like directly without showing modal+ const collectionId = collectionIDs[0]!;+ void (async () => {+ try {+ const collection = await getCollectionByID(collectionId);+ const reactionId = await addReaction(+ collectionId,+ fileId,+ "green_heart",+ collection.key,+ );+ log.info(`Added reaction: ${reactionId}`);+ setFileReactions((prev) => {+ const next = new Map(prev);+ next.set(fileId, [{ collectionId, reactionId }]);+ return next;+ });+ } catch (e) {+ log.error("Failed to add reaction", e);+ }+ })();+ } else {+ // Multiple albums - show album selector+ setOpenLikeAlbumSelector(true);+ }+ } else {+ // Liked in one or more collections - unlike from allvoid (async () => {try {- await deleteReaction(reaction.reactionId);- log.info(`Deleted reaction: ${reaction.reactionId}`);+ for (const reaction of reactions) {+ await deleteReaction(reaction.reactionId);+ log.info(`Deleted reaction: ${reaction.reactionId}`);+ }setFileReactions((prev) => {const next = new Map(prev);next.delete(fileId);return next;});} catch (e) {- log.error("Failed to delete reaction", e);+ log.error("Failed to delete reactions", e);}})();- } else {- // Liked in multiple collections - show unlike album selector- setOpenUnlikeAlbumSelector(true);}} else {// Collection view - toggle like in this specific collection@@ -584,30 +590,13 @@ export const FileViewer: React.FC<FileViewerProps> = ({})();}}- }, [activeCollectionID]);+ }, [activeCollectionID, fileNormalCollectionIDs]);const handleLikeAlbumSelectorClose = useCallback(() => setOpenLikeAlbumSelector(false),[],);- const handleSelectAlbumForLike = useCallback((albumId: number) => {- // TODO: Implement actual like action when API is available- console.log(`Like action: albumId=${albumId}`);- setOpenLikeAlbumSelector(false);- }, []);-- const handleLikeAll = useCallback(() => {- // TODO: Implement actual like all action when API is available- console.log("Like all action");- setOpenLikeAlbumSelector(false);- }, []);-- const handleUnlikeAlbumSelectorClose = useCallback(- () => setOpenUnlikeAlbumSelector(false),- [],- );-const handleToggleAlbumLike = useCallback((albumId: number, isCurrentlyLiked: boolean) => {const file = activeAnnotatedFileRef.current?.file;@@ -675,30 +664,44 @@ export const FileViewer: React.FC<FileViewerProps> = ({[],);- const handleUnlikeAll = useCallback(() => {+ const handleLikeAll = useCallback(() => {const file = activeAnnotatedFileRef.current?.file;if (!file) return;const fileId = file.id;- const reactions = fileReactionsRef.current.get(fileId) ?? [];+ const collectionIDs = fileNormalCollectionIDs?.get(fileId) ?? [];+ const existingReactions = fileReactionsRef.current.get(fileId) ?? [];+ const likedCollectionIDs = new Set(existingReactions.map((r) => r.collectionId));++ // Filter to only collections not already liked+ const collectionsToLike = collectionIDs.filter((id) => !likedCollectionIDs.has(id));void (async () => {try {- for (const reaction of reactions) {- await deleteReaction(reaction.reactionId);- log.info(`Deleted reaction: ${reaction.reactionId}`);+ const newReactions: { collectionId: number; reactionId: string }[] = [];+ for (const collectionId of collectionsToLike) {+ const collection = await getCollectionByID(collectionId);+ const reactionId = await addReaction(+ collectionId,+ fileId,+ "green_heart",+ collection.key,+ );+ log.info(`Added reaction: ${reactionId}`);+ newReactions.push({ collectionId, reactionId });}setFileReactions((prev) => {const next = new Map(prev);- next.delete(fileId);+ const existing = prev.get(fileId) ?? [];+ next.set(fileId, [...existing, ...newReactions]);return next;});} catch (e) {- log.error("Failed to delete reactions", e);+ log.error("Failed to add reactions", e);}})();- setOpenUnlikeAlbumSelector(false);- }, []);+ setOpenLikeAlbumSelector(false);+ }, [fileNormalCollectionIDs]);const handlePublicLikeModalClose = useCallback(() => setOpenPublicLikeModal(false),@@ -929,7 +932,7 @@ export const FileViewer: React.FC<FileViewerProps> = ({const haveUser = !!user;- // Compute all albums and liked album IDs for the unlike selector modal+ // Compute all albums the file belongs to and which are liked for the modalconst { allAlbumsForFile, likedAlbumIDs } = useMemo(() => {const file = activeAnnotatedFile?.file;if (!file) return { allAlbumsForFile: [], likedAlbumIDs: new Set<number>() };@@ -946,7 +949,7 @@ export const FileViewer: React.FC<FileViewerProps> = ({const likedAlbumIDs = new Set(reactions.map((r) => r.collectionId));return { allAlbumsForFile, likedAlbumIDs };- }, [activeAnnotatedFile, fileReactions, collectionNameByID, fileNormalCollectionIDs]);+ }, [activeAnnotatedFile, collectionNameByID, fileNormalCollectionIDs, fileReactions]);const getFiles = useCallback(() => files, [files]);@@ -1014,7 +1017,6 @@ export const FileViewer: React.FC<FileViewerProps> = ({openComments ||openLikes ||openLikeAlbumSelector ||- openUnlikeAlbumSelector ||openPublicLikeModal ||!!moreMenuAnchorEl ||openImageEditor ||@@ -1048,7 +1050,6 @@ export const FileViewer: React.FC<FileViewerProps> = ({openComments,openLikes,openLikeAlbumSelector,- openUnlikeAlbumSelector,openPublicLikeModal,moreMenuAnchorEl,openImageEditor,@@ -1412,17 +1413,10 @@ export const FileViewer: React.FC<FileViewerProps> = ({<LikeAlbumSelectorModalopen={openLikeAlbumSelector}onClose={handleLikeAlbumSelectorClose}- albums={mockAlbumsForLike}- onSelectAlbum={handleSelectAlbumForLike}- onLikeAll={handleLikeAll}- />- <UnlikeAlbumSelectorModal- open={openUnlikeAlbumSelector}- onClose={handleUnlikeAlbumSelectorClose}albums={allAlbumsForFile}likedAlbumIDs={likedAlbumIDs}onToggleAlbum={handleToggleAlbumLike}- onUnlikeAll={handleUnlikeAll}+ onLikeAll={handleLikeAll}/><PublicLikeModalopen={openPublicLikeModal}diff --git a/web/packages/gallery/components/viewer/LikeAlbumSelectorModal.tsx b/web/packages/gallery/components/viewer/LikeAlbumSelectorModal.tsxindex 9d6cc43cf3..8d5a30f4e6 100644--- a/web/packages/gallery/components/viewer/LikeAlbumSelectorModal.tsx+++ b/web/packages/gallery/components/viewer/LikeAlbumSelectorModal.tsx@@ -7,6 +7,29 @@ import React from "react";// Icons// =============================================================================+const HeartFilledIcon: React.FC<{ size?: number; color?: string }> = ({+ size = 18,+ color = "#08C225",+}) => (+ <svg+ width={size}+ height={(size * 15) / 18}+ viewBox="0 0 18 15"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ style={{ display: "block" }}+ >+ <path+ d="M7.40825 13.8538C5.15122 12.1661 0.679688 8.30753 0.679688 4.83524C0.679688 2.54019 2.3639 0.679688 4.67969 0.679688C5.87969 0.679688 7.07969 1.07969 8.67969 2.67969C10.2797 1.07969 11.4797 0.679688 12.6797 0.679688C14.9954 0.679688 16.6797 2.54019 16.6797 4.83524C16.6797 8.30753 12.2082 12.1661 9.95113 13.8538C9.19161 14.4218 8.16777 14.4218 7.40825 13.8538Z"+ fill={color}+ stroke={color}+ strokeWidth="1.36"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);+const HeartOutlineIcon: React.FC<{ size?: number; color?: string }> = ({size = 18,color = "#08C225",@@ -108,9 +131,15 @@ export interface LikeAlbumSelectorModalProps extends ModalVisibilityProps {*/albums: Album[];/**- * Called when user selects an album to like the photo in.+ * Set of album IDs where the photo is currently liked.*/- onSelectAlbum: (albumId: number) => void;+ likedAlbumIDs: Set<number>;+ /**+ * Called when user clicks on an album to toggle like status.+ * @param albumId The album ID+ * @param isCurrentlyLiked Whether the album is currently liked+ */+ onToggleAlbum: (albumId: number, isCurrentlyLiked: boolean) => void;/*** Called when user clicks "Like all" to like in all albums.*/@@ -126,9 +155,13 @@ export const LikeAlbumSelectorModal: React.FC<LikeAlbumSelectorModalProps> = ({open,onClose,albums,- onSelectAlbum,+ likedAlbumIDs,+ onToggleAlbum,onLikeAll,}) => {+ const likedCount = likedAlbumIDs.size;+ const allLiked = likedCount === albums.length && albums.length > 0;+return (<StyledDialog open={open} onClose={onClose}><DialogWrapper>@@ -149,7 +182,14 @@ export const LikeAlbumSelectorModal: React.FC<LikeAlbumSelectorModalProps> = ({<AlbumsSection><AlbumsHeader><AlbumsCount>{albums.length} Albums</AlbumsCount>- <LikeAllButton onClick={onLikeAll}>+ <LikeAllButton+ onClick={!allLiked ? onLikeAll : undefined}+ sx={{+ opacity: !allLiked ? 1 : 0.5,+ cursor: !allLiked ? "pointer" : "default",+ pointerEvents: !allLiked ? "auto" : "none",+ }}+ ><Typographysx={(theme) => ({fontWeight: 500,@@ -162,24 +202,40 @@ export const LikeAlbumSelectorModal: React.FC<LikeAlbumSelectorModalProps> = ({>Like all</Typography>- <HeartOutlineIcon- size={16}- color="var(--mui-palette-text-base)"- />+ {allLiked ? (+ <HeartFilledIcon+ size={16}+ color="var(--mui-palette-text-base)"+ />+ ) : (+ <HeartOutlineIcon+ size={16}+ color="var(--mui-palette-text-base)"+ />+ )}</LikeAllButton></AlbumsHeader><AlbumsList>- {albums.map((album) => (- <AlbumItem key={album.id}>- <AlbumName>{album.name}</AlbumName>- <HeartButton- onClick={() => onSelectAlbum(album.id)}- >- <HeartOutlineIcon />- </HeartButton>- </AlbumItem>- ))}+ {albums.map((album) => {+ const isLiked = likedAlbumIDs.has(album.id);+ return (+ <AlbumItem key={album.id}>+ <AlbumName>{album.name}</AlbumName>+ <HeartButton+ onClick={() =>+ onToggleAlbum(album.id, isLiked)+ }+ >+ {isLiked ? (+ <HeartFilledIcon />+ ) : (+ <HeartOutlineIcon />+ )}+ </HeartButton>+ </AlbumItem>+ );+ })}</AlbumsList></AlbumsSection></ContentContainer>diff --git a/web/packages/gallery/components/viewer/UnlikeAlbumSelectorModal.tsx b/web/packages/gallery/components/viewer/UnlikeAlbumSelectorModal.tsxdeleted file mode 100644index 9de505fbba..0000000000--- a/web/packages/gallery/components/viewer/UnlikeAlbumSelectorModal.tsx+++ /dev/null@@ -1,367 +0,0 @@-import CloseIcon from "@mui/icons-material/Close";-import { Box, Dialog, IconButton, styled, Typography } from "@mui/material";-import { type ModalVisibilityProps } from "ente-base/components/utils/modal";-import React from "react";--// =============================================================================-// Icons-// =============================================================================--const HeartFilledIcon: React.FC<{ size?: number; color?: string }> = ({- size = 18,- color = "#08C225",-}) => (- <svg- width={size}- height={(size * 15) / 18}- viewBox="0 0 18 15"- fill="none"- xmlns="http://www.w3.org/2000/svg"- style={{ display: "block" }}- >- <path- d="M7.40825 13.8538C5.15122 12.1661 0.679688 8.30753 0.679688 4.83524C0.679688 2.54019 2.3639 0.679688 4.67969 0.679688C5.87969 0.679688 7.07969 1.07969 8.67969 2.67969C10.2797 1.07969 11.4797 0.679688 12.6797 0.679688C14.9954 0.679688 16.6797 2.54019 16.6797 4.83524C16.6797 8.30753 12.2082 12.1661 9.95113 13.8538C9.19161 14.4218 8.16777 14.4218 7.40825 13.8538Z"- fill={color}- stroke={color}- strokeWidth="1.36"- strokeLinecap="round"- strokeLinejoin="round"- />- </svg>-);--const HeartOutlineIcon: React.FC<{ size?: number; color?: string }> = ({- size = 18,- color = "#08C225",-}) => (- <svg- width={size}- height={(size * 15) / 18}- viewBox="0 0 18 15"- fill="none"- xmlns="http://www.w3.org/2000/svg"- style={{ display: "block" }}- >- <path- d="M7.40825 13.8538C5.15122 12.1661 0.679688 8.30753 0.679688 4.83524C0.679688 2.54019 2.3639 0.679688 4.67969 0.679688C5.87969 0.679688 7.07969 1.07969 8.67969 2.67969C10.2797 1.07969 11.4797 0.679688 12.6797 0.679688C14.9954 0.679688 16.6797 2.54019 16.6797 4.83524C16.6797 8.30753 12.2082 12.1661 9.95113 13.8538C9.19161 14.4218 8.16777 14.4218 7.40825 13.8538Z"- stroke={color}- strokeWidth="1.36"- strokeLinecap="round"- strokeLinejoin="round"- />- </svg>-);--const UnlikePhotoIllustration: React.FC = () => (- <svg- width="126"- height="121"- viewBox="0 0 126 121"- fill="none"- xmlns="http://www.w3.org/2000/svg"- >- <path- d="M84.7129 23.0781C96.7222 23.0784 105.29 32.8476 105.29 44.499C105.29 53.3449 99.7258 62.2116 93.4453 69.4932C87.0622 76.8936 79.4391 83.2238 74.3574 87.0557C69.973 90.3616 64.031 90.3614 59.6465 87.0557C54.5648 83.2238 46.9408 76.8937 40.5576 69.4932C34.2771 62.2116 28.7129 53.3449 28.7129 44.499C28.713 32.8474 37.2813 23.0781 49.291 23.0781C54.9545 23.0782 60.4297 24.9062 67.001 30.9004C73.5726 24.9056 79.0491 23.0781 84.7129 23.0781Z"- fill="none"- stroke="#888"- strokeWidth="5.73358"- strokeLinecap="round"- strokeLinejoin="round"- strokeDasharray="10 10"- />- </svg>-);--// =============================================================================-// Types-// =============================================================================--interface Album {- id: number;- name: string;-}--export interface UnlikeAlbumSelectorModalProps extends ModalVisibilityProps {- /**- * List of all albums the file belongs to.- */- albums: Album[];- /**- * Set of album IDs where the photo is currently liked.- */- likedAlbumIDs: Set<number>;- /**- * Called when user clicks on an album to toggle like status.- * @param albumId The album ID- * @param isCurrentlyLiked Whether the album is currently liked- */- onToggleAlbum: (albumId: number, isCurrentlyLiked: boolean) => void;- /**- * Called when user clicks "Unlike all" to remove likes from all albums.- */- onUnlikeAll: () => void;-}--/**- * Modal dialog for managing likes across albums.- * Shown when the like button is clicked and the photo is liked- * in multiple albums (from gallery view).- */-export const UnlikeAlbumSelectorModal: React.FC<- UnlikeAlbumSelectorModalProps-> = ({ open, onClose, albums, likedAlbumIDs, onToggleAlbum, onUnlikeAll }) => {- const likedCount = likedAlbumIDs.size;-- return (- <StyledDialog open={open} onClose={onClose}>- <DialogWrapper>- <CloseButton onClick={onClose}>- <CloseIcon sx={{ fontSize: 20 }} />- </CloseButton>-- <ContentContainer>- <IllustrationWrapper>- <UnlikePhotoIllustration />- </IllustrationWrapper>-- <TitleSection>- <Title>Unlike photo</Title>- <Subtitle>- Select the album to unlike the photo from- </Subtitle>- </TitleSection>-- <AlbumsSection>- <AlbumsHeader>- <AlbumsCount>{albums.length} Albums</AlbumsCount>- <UnlikeAllButton- onClick={likedCount > 0 ? onUnlikeAll : undefined}- sx={{ opacity: likedCount > 0 ? 1 : 0.5, cursor: likedCount > 0 ? "pointer" : "default" }}- >- <Typography- sx={(theme) => ({- fontWeight: 500,- fontSize: 14,- color: "#000",- ...theme.applyStyles("dark", {- color: "#fff",- }),- })}- >- Unlike all- </Typography>- <HeartFilledIcon- size={16}- color="var(--mui-palette-text-base)"- />- </UnlikeAllButton>- </AlbumsHeader>-- <AlbumsList>- {albums.map((album) => {- const isLiked = likedAlbumIDs.has(album.id);- return (- <AlbumItem key={album.id}>- <AlbumName>{album.name}</AlbumName>- <HeartButton- onClick={() =>- onToggleAlbum(album.id, isLiked)- }- >- {isLiked ? (- <HeartFilledIcon />- ) : (- <HeartOutlineIcon />- )}- </HeartButton>- </AlbumItem>- );- })}- </AlbumsList>- </AlbumsSection>- </ContentContainer>- </DialogWrapper>- </StyledDialog>- );-};--// =============================================================================-// Styled Components-// =============================================================================--const StyledDialog = styled(Dialog)(({ theme }) => ({- "& .MuiDialog-paper": {- width: 381,- maxWidth: "calc(100% - 32px)",- borderRadius: 28,- backgroundColor: "#fff",- padding: 0,- margin: 16,- overflow: "visible",- boxShadow: "none",- border: "1px solid #E0E0E0",- ...theme.applyStyles("dark", {- backgroundColor: "#1b1b1b",- border: "1px solid rgba(255, 255, 255, 0.18)",- }),- },- "& .MuiBackdrop-root": { backgroundColor: "rgba(0, 0, 0, 0.5)" },-}));--const DialogWrapper = styled(Box)(() => ({- position: "relative",- padding: "58px 24px 24px 24px",-}));--const CloseButton = styled(IconButton)(({ theme }) => ({- position: "absolute",- top: 11,- right: 12,- backgroundColor: "#FAFAFA",- color: "#000",- padding: 10,- "&:hover": { backgroundColor: "#F0F0F0" },- ...theme.applyStyles("dark", {- backgroundColor: "rgba(255, 255, 255, 0.12)",- color: "#fff",- "&:hover": { backgroundColor: "rgba(255, 255, 255, 0.16)" },- }),-}));--const ContentContainer = styled(Box)(() => ({- display: "flex",- flexDirection: "column",- alignItems: "center",- gap: 16,-}));--const IllustrationWrapper = styled(Box)(() => ({- display: "flex",- justifyContent: "center",- alignItems: "center",- marginBottom: -12,-}));--const TitleSection = styled(Box)(() => ({- display: "flex",- flexDirection: "column",- alignItems: "center",- gap: 9,- textAlign: "center",- marginBottom: 14,-}));--const Title = styled(Typography)(({ theme }) => ({- fontWeight: 600,- fontSize: 24,- lineHeight: "22px",- letterSpacing: "-0.48px",- color: "#000",- ...theme.applyStyles("dark", { color: "#fff" }),-}));--const Subtitle = styled(Typography)(({ theme }) => ({- fontWeight: 500,- fontSize: 14,- lineHeight: "17px",- color: "#666666",- maxWidth: 295,- ...theme.applyStyles("dark", { color: "rgba(255, 255, 255, 0.7)" }),-}));--const AlbumsSection = styled(Box)(({ theme }) => ({- width: "100%",- backgroundColor: "rgba(162, 162, 162, 0.12)",- borderRadius: 27,- padding: "16px 0 0 0",- maxHeight: 313,- display: "flex",- flexDirection: "column",- overflow: "hidden",- ...theme.applyStyles("dark", {- backgroundColor: "rgba(162, 162, 162, 0.12)",- }),-}));--const AlbumsHeader = styled(Box)(() => ({- display: "flex",- justifyContent: "space-between",- alignItems: "center",- padding: "0 16px 0 25px",- marginBottom: 16,-}));--const AlbumsCount = styled(Typography)(({ theme }) => ({- fontWeight: 500,- fontSize: 14,- lineHeight: "17px",- color: "#000",- ...theme.applyStyles("dark", { color: "#fff" }),-}));--const UnlikeAllButton = styled(Box)(({ theme }) => ({- display: "flex",- alignItems: "center",- gap: 10,- padding: 10,- backgroundColor: "#fff",- borderRadius: 14,- cursor: "pointer",- "&:hover": { backgroundColor: "#EBEBEB" },- ...theme.applyStyles("dark", {- backgroundColor: "#1b1b1b",- "&:hover": { backgroundColor: "#252525" },- }),-}));--const AlbumsList = styled(Box)(({ theme }) => ({- display: "flex",- flexDirection: "column",- gap: 6,- padding: "0 12px 12px 12px",- overflowY: "auto",- maxHeight: 241,- "&::-webkit-scrollbar": { width: 6 },- "&::-webkit-scrollbar-track": { background: "transparent" },- "&::-webkit-scrollbar-thumb": {- background: "rgba(0, 0, 0, 0.2)",- borderRadius: 3,- },- ...theme.applyStyles("dark", {- "&::-webkit-scrollbar-thumb": {- background: "rgba(255, 255, 255, 0.2)",- },- }),-}));--const AlbumItem = styled(Box)(({ theme }) => ({- display: "flex",- alignItems: "center",- justifyContent: "space-between",- gap: 12,- padding: "10px 10px 10px 16px",- backgroundColor: "#fff",- borderRadius: 16,- ...theme.applyStyles("dark", { backgroundColor: "#212121" }),-}));--const AlbumName = styled(Typography)(({ theme }) => ({- fontWeight: 500,- fontSize: 14,- lineHeight: "17px",- color: "#000",- flex: 1,- ...theme.applyStyles("dark", { color: "#fff" }),-}));--const HeartButton = styled(Box)(() => ({- width: 32,- height: 32,- display: "flex",- alignItems: "center",- justifyContent: "center",- backgroundColor: "rgba(8, 194, 37, 0.06)",- borderRadius: 9.6,- cursor: "pointer",- "&:hover": { backgroundColor: "rgba(8, 194, 37, 0.12)" },-}));