Skip to content
Snippets Groups Projects
Select Git revision
  • cd0ad56afd3cb7ac40d4a813f1eac4c9dbeda965
  • mui5-tetras-main-stable default protected
  • mui5-tetras-main-old-stable
  • preprod protected
  • 75-dernieres-ameliorations-avant-workshop-du-7-02
  • wip-fix-xywh
  • wip-positionement-annot
  • wip-surface-transformer
  • uploads-file
  • 69-la-video-demare-quand-on-fait-glisser-le-slider-et-le-clic-creer-un-decalage-entre-le-player
  • 61-recettage-des-outils-d-annotation
  • gestion_multiple_ouverture_pannel_annotation
  • autorisation_un_pannel_annotation
  • autorisation_un_pannel_edition_annotation
  • récupération_temps_video
  • save-shapes-and-position
  • fix-error-create-annotation-pannel
  • time-saving-on-annotation
  • tetras-main protected
  • fix-poc-mirador
  • tetras-antho-test
21 results

AnnotationFormManifestNetwork.js

Blame
  • AnnotationFormManifestNetwork.js 1.18 KiB
    import React from 'react';
    import {
      Grid, Paper, TextField, Typography, Button, Link,
    } from '@mui/material';
    import PropTypes from 'prop-types';
    import { isValidUrl } from '../utils';
    
    /** Form part for edit annotation content and body */
    function AnnotationFormNetwork({ manifestNetwork, updateManifestNetwork }) {
      return (
        <Paper style={{ padding: '5px' }}>
          <Typography variant="overline">
            Network
          </Typography>
          <Grid>
            <TextField
              value={manifestNetwork}
              onChange={(event) => updateManifestNetwork(event.target.value.trim())}
              label="Manifest URL"
              type="url"
            />
            {
              isValidUrl(manifestNetwork) ? (
                <Link
                  href={manifestNetwork}
                  target="_blank"
                >
                  {manifestNetwork}
                </Link>
              ) : (
                <Typography variant="caption">
                  Not a valid URL
                </Typography>
              )
            }
          </Grid>
        </Paper>
      );
    }
    
    AnnotationFormNetwork.propTypes = {
      manifestNetwork: PropTypes.string.isRequired,
      updateManifestNetwork: PropTypes.func.isRequired,
    };
    
    export default AnnotationFormNetwork;