2024-07-06 14:13:09 +02:00
|
|
|
import React from "react";
|
|
|
|
import {Float, FloatProperties} from "../Floating/Float";
|
|
|
|
import {classes, Modify} from "../../Utils";
|
|
|
|
|
|
|
|
export function Suggestible({className, suggestions, mode, content, role, children, ...props}: Modify<FloatProperties, {
|
|
|
|
/**
|
|
|
|
* Suggestions element.
|
|
|
|
*/
|
|
|
|
suggestions: React.ReactNode;
|
|
|
|
|
|
|
|
content?: never;
|
|
|
|
role?: never;
|
|
|
|
}>)
|
|
|
|
{
|
|
|
|
// Default mode for showing suggestions is "focus".
|
|
|
|
mode = mode ?? "focus";
|
|
|
|
|
|
|
|
return (
|
2024-07-07 13:15:28 +02:00
|
|
|
<Float className={classes("suggestions", className)} role={"select"} dismissible={false} content={suggestions} mode={mode} {...props}>
|
2024-07-06 14:13:09 +02:00
|
|
|
{children}
|
|
|
|
</Float>
|
|
|
|
);
|
|
|
|
}
|