docs: fix notifcation/message import statement (#49283)

This commit is contained in:
afc163 2024-06-06 17:25:50 +08:00 committed by GitHub
parent aa17f703d2
commit 308feb19fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,12 +116,21 @@ const ComponentMeta: React.FC<ComponentMetaProps> = (props) => {
return [source, source];
}, [component, source]);
const transformComponentName = (componentName: string) => {
if (componentName === 'Notifiction' || componentName === 'Message') {
return componentName.toLowerCase();
}
return componentName;
};
// ======================== Render ========================
const importList = [
<span key="import" className={styles.import}>
import
</span>,
<span key="component" className={styles.component}>{`{ ${component} }`}</span>,
<span key="component" className={styles.component}>{`{ ${transformComponentName(
component,
)} }`}</span>,
<span key="from" className={styles.from}>
from
</span>,