mirror of
https://gh.wpcy.net/https://github.com/elementor/hello-theme.git
synced 2026-04-30 15:09:17 +08:00
29 lines
771 B
JavaScript
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;
|