@gechiui/components
Version:
UI components for GeChiUI.
36 lines (32 loc) • 732 B
JavaScript
/**
* GeChiUI dependencies
*/
import { __ } from '@gechiui/i18n';
import { link, Icon, chevronRight } from '@gechiui/icons';
/**
* Internal dependencies
*/
import Cell from './cell';
import styles from './styles.scss';
const { placeholderColor } = styles;
export default function LinkCell( {
value,
valueMask,
onPress,
showIcon = true,
} ) {
return (
<Cell
icon={ showIcon && link }
label={ __( '链接至' ) }
// since this is not actually editable, we treat value as a placeholder
value={ valueMask || value || __( 'Search or type URL' ) }
valueStyle={
!! ( value || valueMask ) ? undefined : placeholderColor
}
onPress={ onPress }
>
<Icon icon={ chevronRight }></Icon>
</Cell>
);
}