diff options
author | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-09-06 19:53:23 -0500 |
---|---|---|
committer | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-09-06 19:53:23 -0500 |
commit | ef4fb0a5277ee99bd0f1747b77e733ef7f02460d (patch) | |
tree | 2c7b306eaa814dedccb987a28a1cd050fdd94136 /components/Breadcrumbs/index.tsx | |
parent | a66d6b395e22d6506319cc20b6dfab0e88cb0f39 (diff) | |
download | homepage-ef4fb0a5277ee99bd0f1747b77e733ef7f02460d.tar.xz homepage-ef4fb0a5277ee99bd0f1747b77e733ef7f02460d.zip |
Make BreadCrumbs domain agnostic
Diffstat (limited to 'components/Breadcrumbs/index.tsx')
-rw-r--r-- | components/Breadcrumbs/index.tsx | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/components/Breadcrumbs/index.tsx b/components/Breadcrumbs/index.tsx deleted file mode 100644 index d773b33..0000000 --- a/components/Breadcrumbs/index.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React, { Children, FC } from "react"; -import Link from "next/link"; -import styles from './breadcrumbs.module.scss'; -import clsx from 'clsx'; - -export type BreadcrumbsProps = { - className?: string; - style?: object; - children: React.ReactNode; -}; - -const Breadcrumbs : FC<BreadcrumbsProps> = ({children, className, ...props}) => ( - <span className={clsx(styles.breadcrumbs, className)} {...props}> - {Children.map(children, (child, index) => { - return ( - <> - { - index !== 0 ? ( - <span className={styles.divider}>/</span> - ) : undefined - } - {child} - </> - ); - })} - </span> -); - -export type CrumbProps = { - children: React.ReactNode; -}; - -const Crumb : FC<CrumbProps> = ({children, ...props}) => ( - <span className={styles.crumb} {...props}> - {children} - </span> -); - -export type LinkCrumbProps = { - href: string; - children: React.ReactNode; -} - -const LinkCrumb : FC<LinkCrumbProps> = ({children, href, ...props}) => ( - <Crumb> - <Link href={href}> - {children} - </Link> - </Crumb> -); - -export { - Crumb, - Breadcrumbs, - LinkCrumb -}; |