1
0
Fork 0
mirror of https://github.com/elementor/hello-theme.git synced 2026-07-27 14:01:37 +08:00
hello-theme/modules/admin-home/assets/js/components/link/link-or-title.js
2025-06-05 01:27:14 +03:00

29 lines
771 B
JavaScript

import Stack from '@elementor/ui/Stack';
import Typography from '@elementor/ui/Typography';
import Link from '@elementor/ui/Link';
import { decode } from 'html-entities';
const LinkOrTitle = ( { title, link, sublinks, onClick, target } ) => (
<Stack direction="column">
<Typography variant="subtitle1" color="text.primary">
{ link && 0 === sublinks.length ? (
<Link
color="inherit"
underline="hover"
onClick={ onClick }
href={ link }
target={ target }
sx={ { lineHeight: 'initial', fontWeight: 'normal' } }
>
{ decode( title ) }
</Link>
) : (
<span style={ { lineHeight: 'initial', fontWeight: 'normal' } }>
{ decode( title ) }
</span>
) }
</Typography>
</Stack>
);
export default LinkOrTitle;