import { colord, AnyColor } from 'colord';
import { Attributes, Lang } from '../../../types';
import { findBackgroundColor, findTextColor } from '../../../util/colors';
import { languages } from '../../../util/languages';
export const SimpleStringStart = (attributes: Attributes) => {
const {
language,
bgColor,
textColor,
footerString,
footerLink,
footerLinkTarget,
disablePadding,
} = attributes;
const textC = colord(textColor as AnyColor);
const text = textColor?.startsWith('var(')
? findTextColor(attributes) ?? textColor
: textC.isDark()
? textC.lighten(0.05).toHex()
: textC.darken(0.05).toHex();
return (
);
};
const Inner = ({
text,
color,
link,
linkTarget,
}: {
text?: string;
color: string;
link?: string;
linkTarget?: boolean;
}) => {
if (!link) return <>{text}>;
const style = {
color,
// attempt to reset the link to not inheret from theme
textDecoration: 'none',
fontWeight: 'normal',
border: 'none',
background: 'none',
borderRadius: '0',
padding: '0',
margin: '0',
};
if (linkTarget) {
return (
{text}
);
}
return (
{text}
);
};