mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 15:21:53 +08:00
a function can't have the same name as an interface, in addition to that, DocumentScreen is imported and used as a component and not as an interface in other files.
25 lines
596 B
Plaintext
25 lines
596 B
Plaintext
```tsx
|
|
// YourPage.ts|tsx
|
|
|
|
import PageLayout from './PageLayout';
|
|
import Document from './Document';
|
|
import SubDocuments from './SubDocuments';
|
|
import DocumentHeader from './DocumentHeader';
|
|
import DocumentList from './DocumentList';
|
|
|
|
export interface DocumentScreenProps {
|
|
user?: {};
|
|
document?: Document;
|
|
subdocuments?: SubDocuments[];
|
|
}
|
|
|
|
export function DocumentScreen({ user, document, subdocuments }: DocumentScreenProps) {
|
|
return (
|
|
<PageLayout user={user}>
|
|
<DocumentHeader document={document} />
|
|
<DocumentList documents={subdocuments} />
|
|
</PageLayout>
|
|
);
|
|
}
|
|
```
|