Implement Breadcrumbs component
This commit is contained in:
parent
39a7f64252
commit
5fe9f484d3
21
src/components/breadcrumbs.tsx
Normal file
21
src/components/breadcrumbs.tsx
Normal file
@ -0,0 +1,21 @@
|
||||
import { isArray } from "lodash";
|
||||
import React from "react";
|
||||
|
||||
type Props = {
|
||||
divider?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* use: <Breadcrumbs divider="/","●" or any> children </Breadcrumbs> */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
export default function Breadcrumbs({divider ,children}: Props) {
|
||||
return(
|
||||
<>
|
||||
{divider} {
|
||||
|
||||
isArray(children) ? children.join(' '+divider+' ') : children
|
||||
}
|
||||
{divider}
|
||||
</>
|
||||
)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user