/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 *
 * OpenCRVS is also distributed under the terms of the Civil Registration
 * & Healthcare Disclaimer located at http://opencrvs.org/license.
 *
 * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
 */
import * as React from 'react'
import styled, { withTheme } from 'styled-components'
import { ITheme } from '../theme'

const StyledSpan = styled.span`
  color: ${({ theme }) => theme.colors.positive};
  display: flex;
  flex-direction: row;
  align-items: center;
`

interface IProps {
  theme: ITheme
}

const ValidIndicatorComponent = ({ theme }: IProps) => (
  <StyledSpan>
    <svg width="19px" height="16px" viewBox="0 0 19 16" version="1.1">
      <title>893F2164-9EDF-40D3-A792-B756B66B4205</title>
      <desc>Created with sketchtool.</desc>
      <defs />
      <g
        id="Page-1"
        stroke="none"
        strokeWidth="1"
        fill="none"
        fillRule="evenodd"
        strokeLinecap="round"
        strokeLinejoin="round"
      >
        <g
          id="Interface/Forms"
          transform="translate(-380.000000, -2459.000000)"
          fillRule="nonzero"
          stroke={theme.colors.positive}
          strokeWidth="2.5"
        >
          <polyline
            id="Line"
            points="382 2466.55932 387.660582 2473 397 2461"
          />
        </g>
      </g>
    </svg>
    &nbsp;Valid
  </StyledSpan>
)

export const ValidIndicator = withTheme(ValidIndicatorComponent)
