All files / client/src/views/program-item/signup/components AdmissionTicketLink.tsx

80% Statements 4/5
100% Branches 0/0
100% Functions 2/2
80% Lines 4/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30                      520x 97x                     1x 97x          
import { ReactElement } from "react";
import { useTranslation } from "react-i18next";
import { NavLink } from "react-router";
import styled from "styled-components";
import { AppRoute } from "client/app/routes";
import { ButtonStyle } from "client/components/componentStyles";
import { ProgramItemButton } from "client/views/program-item/components/ProgramItemButton";
 
interface Props {
  programItemId: string;
}
export const AdmissionTicketLink = ({ programItemId }: Props): ReactElement => {
  const { t } = useTranslation();
 
  return (
    <StyledLink to={`${AppRoute.PROGRAM_ITEM}/${programItemId}/admission`}>
      <ProgramItemButton buttonStyle={ButtonStyle.PRIMARY}>
        {t("button.showAdmissionTicket")}
      </ProgramItemButton>
    </StyledLink>
  );
};
 
const StyledLink = styled(NavLink)`
  @media (max-width: ${(props) => props.theme.breakpointDesktop}) {
    width: 100%;
    min-width: 0;
  }
`;