Commit b327f8dc authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: don't hide metadata panel when no properties

parent 5845e921
Pipeline #180257 passed with stage
in 5 minutes and 18 seconds
......@@ -381,7 +381,7 @@ function ItemPropertiesList({
dateLastUpdated?: string
}) {
const groupedProperties = useMemo(() => {
if (properties === undefined || properties.length === 0) return null
if (properties === undefined || properties.length === 0) return {}
const grouped: Record<string, Array<ItemProperty>> = {}
properties.forEach((property) => {
......@@ -396,10 +396,19 @@ function ItemPropertiesList({
return grouped
}, [properties])
if (groupedProperties === null) return null
const sortedLabels = Object.keys(groupedProperties).sort()
if (
sortedLabels.length === 0 &&
(contributors == null || contributors.length === 0) &&
dateCreated == null &&
dateLastUpdated == null &&
(licenses == null || licenses.length === 0) &&
source == null
) {
return null
}
return (
<VStack className="space-y-4">
<SubSectionTitle as="h2">Details</SubSectionTitle>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment