@mui/icons-material#HighlightOffOutlined TypeScript Examples

The following examples show how to use @mui/icons-material#HighlightOffOutlined. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImagePicker.tsx    From Cromwell with MIT License 5 votes vote down vote up
ImagePicker = (props: ImagePickerProps) => {
    const [internalValue, setInternalValue] = useState<string | undefined>();
    const value = (props.value !== undefined && props.value !== '') ? props.value : internalValue;

    const pickImage = async () => {
        const photoPath = await getFileManager()?.getPhoto({ initialFileLocation: value });
        if (photoPath) {
            setImage(photoPath);
        }
    }

    const setImage = (val: string | undefined) => {
        if (val === '') val = null;
        props.onChange?.(val);

        if (props.value === undefined)
            setInternalValue(val);
    }

    const getDimension = (dimension: string | number) => dimension && (typeof dimension === 'number' ? dimension + 'px' : dimension);

    const element = (
        <div className={`${styles.wrapper} ${props.className ?? ''} ${props.classes?.root ?? ''} ${props.variant ?? ''}`}
            style={{ ...(props.style ?? {}) }}>
            <Tooltip title={props.toolTip ?? 'Pick an image'}>
                <MenuItem
                    style={{
                        padding: '0',
                        width: getDimension(props.width),
                        minWidth: getDimension(props.width),
                        height: getDimension(props.height),
                    }}
                    className={styles.imageWrapper}>
                    <div className={`${styles.image} ${props.classes?.image}`}
                        onClick={pickImage}
                        style={{
                            backgroundImage: `url(${value})`,
                            backgroundSize: props.backgroundSize ?? 'cover',
                            width: getDimension(props.width),
                            minWidth: getDimension(props.width),
                            height: getDimension(props.height),
                        }}>
                        {!value && <AddPhotoAlternateOutlinedIcon
                            style={{
                                width: '65%',
                                height: '65%',
                                maxWidth: '30px',
                                maxHeight: '30px',
                            }}
                        />}
                    </div>
                </MenuItem>
            </Tooltip>
            {!props.hideSrc && (
                <Tooltip title={props.toolTip ?? ''}>
                    <TextField
                        value={value ?? ''}
                        onChange={e => {
                            setImage(e.target.value);
                        }}
                        label={props.label}
                        fullWidth
                        variant={props.variant ?? "standard"}
                    />
                </Tooltip>
            )}
            {value && props.showRemove && (
                <IconButton
                    className={styles.removeBtn}
                    onClick={(e) => { e.stopPropagation(); setImage(undefined); }}>
                    <HighlightOffOutlined />
                </IconButton>
            )}
        </div>
    );
    return element;
}
Example #2
Source File: dialogConfirm.tsx    From Search-Next with GNU General Public License v3.0 5 votes vote down vote up
ErrorContent = () => {
  return (
    <>
      <HighlightOffOutlined className="text-red-500 mr-1" />
    </>
  );
}