import React, { ReactNode } from 'react'; import styled from 'styled-components'; import { lineHeight, padding } from 'styled-system'; import { ThemeProps } from '@t3n/theme'; import Link, { LinkProps } from '../Link'; import Text from '../Text'; // TODO: Finish variant implementation export interface BreadcrumbsItemProps extends Pick { href?: string; className?: string; label: string; linkComponent?: ( props: React.AnchorHTMLAttributes & Pick & { href: string }, ) => JSX.Element; } export const BreadcrumbsItem = styled( ({ href, label, className, variant, linkComponent: LinkComponent = Link, }: BreadcrumbsItemProps) => (
  • {href ? ( {label} ) : ( {label} )}
  • ), )` position: relative; ${({ theme }) => padding({ theme, pl: 3, pr: 3 })} ${({ theme }) => lineHeight({ theme, lineHeight: 3 })} margin-right: -2px; &:after { content: ''; position: absolute; display: block; width: 0; height: 0; bottom: 50%; left: 0; margin-bottom: -6px; border-top: 0.333rem solid transparent; border-bottom: 0.333rem solid transparent; border-left: 0.333rem solid ${({ theme }: ThemeProps) => theme.colors.text.secondary}; } &:first-child { padding-left: 0; &:after { display: none; } } &:last-child { padding-right: 0; } `; const BreadcrumbsList = styled.ul` margin: 0; padding: 0; padding-bottom: 1rem; list-style-type: none; display: flex; flex-wrap: wrap; `; const Breadcrumbs: React.FC<{ children?: ReactNode }> = ({ children }) => { return ( ); }; export default Breadcrumbs;