New source found from dndbeyond.com
This commit is contained in:
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import type { GenericContentSlot } from '../../schemas/generic-slot-schema';
|
||||
import type { AmplienceContentItem, BaseContentItem } from '../../types';
|
||||
import { AmplienceComponent } from '../AmplienceComponent';
|
||||
|
||||
export const GenericSlot = ({ item: { content }, locale }: AmplienceContentItem<GenericContentSlot>) => {
|
||||
// Amplience Generic Slot is a localized component, unlike Amplience Core components.
|
||||
// Because of this, it receives two different types of responses that we need to handle below.
|
||||
const item = (content?.values?.find((item) => item.locale === locale)?.value ?? content) as
|
||||
| BaseContentItem
|
||||
| undefined;
|
||||
|
||||
if (!item) return null;
|
||||
|
||||
return <AmplienceComponent item={item} locale={locale} />;
|
||||
};
|
||||
Reference in New Issue
Block a user