import React from 'react' import { linkClasses } from '@freesewing/utils' /** * An anchor link component * * @param {object} props - All React props * @param {array} props.children - The content to go in the layout * @param {array} props.id - The ID of the anchor to link to * @param {array} props.title - An optional link title */ export const AnchorLink = ({ children, id = '', title = false }) => ( {children} ) /** * A regular link component * * @param {object} props - All React props * @param {array} props.children - The content to go in the layout * @param {array} props.href - The target to link to * @param {array} props.title - An optional link title * @param {string} props.className - Any non-default CSS classes to apply * @param {string} props.style - Any non-default styles to apply */ export const Link = ({ href, title = false, children, className = linkClasses, target, style = {}, }) => ( {children} ) const BaseLink = Link /** * A regular link, but on a success background * * @param {object} props - All React props * @param {array} props.children - The content to go in the layout * @param {array} props.href - The target to link to * @param {array} props.title - An optional link title * @param {string} props.className - Any non-default CSS classes to apply * @param {string} props.style - Any non-default styles to apply */ export const SuccessLink = ({ href, title = false, children, className = `${linkClasses} tw-text-success-content hover:tw-text-success-content`, style = {}, }) => ( {children} ) export const CardLink = ({ href, title, icon, children, Link, className = 'tw-bg-base-200 tw-text-base-content', }) => { if (!Link) Link = BaseLink return (

{title} {icon}

{children} ) }