get-illustration
<illustrations.get-illustration>
provider获取插画。
Examples
Usage in pro-code
import { unwrapProvider } from "@next-core/utils/general";
import type { getIllustration as _getIllustration } from "@next-bricks/illustrations/data-providers/get-illustration";
// Use `unwrapProvider` to get the original function of a provider
const getIllustration = unwrapProvider<typeof _getIllustration>(
"illustrations.get-illustration"
);
function MyComponent() {
const src = getIllustration({ category: "feedback", name: "fail" });
return <img src={src} />;
}
Definition
Parameters
# | Name | Description | Type |
---|---|---|---|
1 | props | IllustrationProps |
Returns
string | undefined