docs: added algolia guide (#11971)

* initial

* finished changes

* small title change

* improve title

* add cover
This commit is contained in:
Shahed Nasser
2025-03-27 20:22:40 +02:00
committed by GitHub
parent 532780897b
commit 82da3c97a5
9 changed files with 14117 additions and 11487 deletions

View File

@@ -10,7 +10,12 @@ type StringInfo = {
type NoteLayoutProps = NoteProps
export const NoteLayout = ({ type, title, children }: NoteLayoutProps) => {
export const NoteLayout = ({
type,
title,
children,
forceMultiline = false,
}: NoteLayoutProps) => {
const getStringInfoFromChildren = (nodes: React.ReactNode): StringInfo => {
let allStringChildren = true
const stringChildren: string[] = []
@@ -63,6 +68,13 @@ export const NoteLayout = ({ type, title, children }: NoteLayoutProps) => {
}
}
const { allStringChildren, stringChildren } = useMemo(() => {
if (forceMultiline) {
return {
allStringChildren: false,
stringChildren: "",
}
}
const { allStringChildren, stringChildren } =
getStringInfoFromChildren(children)
@@ -70,7 +82,7 @@ export const NoteLayout = ({ type, title, children }: NoteLayoutProps) => {
allStringChildren,
stringChildren: stringChildren.join(""),
}
}, [children])
}, [children, forceMultiline])
return (
<div

View File

@@ -10,6 +10,7 @@ export type NoteProps = {
type?: "default" | "warning" | "success" | "error" | "check" | "soon"
title?: string
children?: React.ReactNode
forceMultiline?: boolean
}
export const Note = ({ type = "default", ...props }: NoteProps) => {