diff --git a/public/locales/de-DE/translation.json b/public/locales/de-DE/translation.json index 219de9f..5b97c6a 100644 --- a/public/locales/de-DE/translation.json +++ b/public/locales/de-DE/translation.json @@ -231,6 +231,11 @@ "isStored": "Auf Server gespeichert", "isProxying": "Wird weitergeleitet" } + }, + "expandedUrls": { + "text_zero": "Keine gekürzten URLs gefunden", + "text_one": "Eine URL entkürzt", + "text_other": "{{count}} URLs entkürzt" } } } diff --git a/public/locales/en-US/translation.json b/public/locales/en-US/translation.json index d6fcc4b..871fcf5 100644 --- a/public/locales/en-US/translation.json +++ b/public/locales/en-US/translation.json @@ -231,6 +231,11 @@ "isStored": "Stored on Server", "isProxying": "Being forwarded" } + }, + "expandedUrls": { + "text_zero": "No shortened URLs found", + "text_one": "Expanded 1 URL", + "text_other": "Expanded {{count}} URLs" } } } diff --git a/src/components/ExpandableListItem.tsx b/src/components/ExpandableListItem.tsx new file mode 100644 index 0000000..c0afd83 --- /dev/null +++ b/src/components/ExpandableListItem.tsx @@ -0,0 +1,38 @@ +import {ReactElement, ReactNode, useState} from "react" + +import {Box, Collapse, ListItemButton, ListItemIcon, ListItemText, useTheme} from "@mui/material" + +export interface ExpandedUrlsListItemProps { + data: T[] + icon: ReactElement + title: string + children: ReactNode +} + +export default function ExpandedUrlsListItem({ + data, + children, + icon, + title, +}: ExpandedUrlsListItemProps): ReactElement { + const [isExpanded, setIsExpanded] = useState(false) + const theme = useTheme() + + return ( + <> + { + if (data.length > 0) { + setIsExpanded(value => !value) + } + }} + > + {icon} + {title} + + + {children} + + + ) +} diff --git a/src/components/LanguageButton.tsx b/src/components/LanguageButton.tsx index d723f40..3c7a763 100644 --- a/src/components/LanguageButton.tsx +++ b/src/components/LanguageButton.tsx @@ -22,8 +22,6 @@ export default function LanguageButton(): ReactElement { const {isLocked, showDialog} = useContext(LockNavigationContext) const {i18n} = useTranslation() - console.log(i18n.resolvedLanguage, SORTED_ENTRIES) - return (