import * as React from "react"; import { get } from "lodash"; import { Link } from "react-router-dom"; import styled from "styled-components"; import { ItemTypes } from "./types"; import { Button, ListItem } from "../"; import { IconSource } from "../Icon/types"; import { EditorMode } from "@sc/modules/v2/Editor/types"; interface LinkProps { mode?: EditorMode; filter?: any; items: any[]; linkStyle: any; showSocial?: boolean; style?: any; } export const Links: React.FC = ({ filter, items, linkStyle, showSocial, style, }) => { let links = items; if (filter) links = items.filter((itm) => itm.column === filter); const LI = styled.li` &:hover { text-decoration: underline; } `; return (
{links.map((itm) => { if (get(itm, "type", ItemTypes.TEXT) === ItemTypes.TEXT) { return (
  • {itm.caption}
  • ); } if (get(itm, "type") === ItemTypes.LISTITEM) { return ( {itm.caption} ); } if (get(itm, "type") === ItemTypes.BUTTON) { return (
  • ); } })}
    ); };