old_contents: // @flow
  import { Link } from 'react-router-dom';
  import { Component } from 'react';
  import Button from 'app/components/Button';
  import styles from './AnnouncementInLine.css';
  import type { ID } from 'app/models';
  
  type Props = {
    placeholder?: string,
    event?: ID,
    meeting?: ID,
    group?: ID,
    createAnnouncement: (CreateAnnouncement) => Promise<*>,
    handleSubmit: (Function) => void,
    actionGrant: boolean,
    hidden?: boolean,
    button?: boolean,
    className?: string,
  };
  
  class AnnouncementInLine extends Component<Props> {
    render() {
      const { actionGrant, event, meeting, group } = this.props;
  
      return (
        <div>
          {actionGrant && (event || meeting || group) && (
            <div>
              <Link to={'/announcements'} state={{ event, meeting }}>
                <Button className={styles.announcementButton}>
                  Ny kunngjøring
                </Button>
              </Link>
            </div>
          )}
        </div>
      );
    }
  }
  
  export default AnnouncementInLine;
  
new_contents: // @flow
  import { Link } from 'react-router-dom';
  import Button from 'app/components/Button';
  import styles from './AnnouncementInLine.css';
  import type { ID } from 'app/models';
  import { useSelector } from 'react-redux';
  
  type Props = {
    event?: ID,
    meeting?: ID,
    group?: ID,
  };
  
  const AnnouncementInLine = ({ event, meeting, group }: Props) => {
    const actionGrant = useSelector((state) => state.allowed.announcements);
  
    return (
      <div>
        {actionGrant && (event || meeting || group) && (
          <div>
            <Link
              to={{
                pathname: '/announcements',
                state: { event, meeting, group },
              }}
            >
              <Button className={styles.announcementButton}>
                Ny kunngjøring
              </Button>
            </Link>
          </div>
        )}
      </div>
    );
  };
  
  export default AnnouncementInLine;
  
subject: fix AnnouncementInLine (flow++)