Skip to content

Commit

Permalink
Get entity type instead of using static 'project' text
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgros committed Oct 4, 2024
1 parent 213fc12 commit 1ae71b1
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import React from 'react'
import { useGetEntityHeader } from '../../synapse-queries/index'
import {
convertToEntityType,
entityTypeToFriendlyName,
} from '../../utils/functions/EntityTypeUtils'
import { EntityLink } from '../EntityLink'
import { Link, Typography } from '@mui/material'

Expand All @@ -11,11 +16,25 @@ type InheritanceMessageProps = {

export function InheritanceMessage(props: InheritanceMessageProps) {
const { isProject, isInherited, isAfterUpload = false, benefactorId } = props
const { data: benefactorHeader } = useGetEntityHeader(
benefactorId,
undefined,
{
enabled: Boolean(benefactorId),
},
)

if (isAfterUpload) {
return (
<>
<Typography variant={'body1'}>
Currently, the sharing settings are inherited from the project named
Currently, the sharing settings are inherited from the{' '}
{benefactorHeader
? entityTypeToFriendlyName(
convertToEntityType(benefactorHeader.type),
).toLowerCase()
: 'container'}{' '}
named
{benefactorId ? (
<>
{' '}
Expand Down

0 comments on commit 1ae71b1

Please sign in to comment.