refactor(SW-1877): a bit of cleanup of code to maintain patterns and separate components and types
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { cx } from "class-variance-authority"
|
||||
import { Breadcrumb as AriaBreadcrumb } from "react-aria-components"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
||||
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
|
||||
import styles from "./breadcrumbs.module.css"
|
||||
|
||||
import type { BreadcrumbProps } from "./breadcrumbs"
|
||||
|
||||
export function Breadcrumb({
|
||||
className = "",
|
||||
href,
|
||||
children,
|
||||
...props
|
||||
}: BreadcrumbProps) {
|
||||
return (
|
||||
<AriaBreadcrumb className={cx(styles.listItem, className)} {...props}>
|
||||
{href ? (
|
||||
<>
|
||||
<Link color="peach80" href={href} variant="breadcrumb">
|
||||
{children}
|
||||
</Link>
|
||||
<MaterialIcon
|
||||
icon="chevron_right"
|
||||
size={20}
|
||||
aria-hidden="true"
|
||||
color="Icon/Interactive/Secondary"
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
children
|
||||
)}
|
||||
</AriaBreadcrumb>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user