unpack props inside fn
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
@@ -38,15 +38,19 @@ import { TechDocsPageWrapper } from './TechDocsPageWrapper';
|
||||
import { TechDocsPicker } from './TechDocsPicker';
|
||||
import { DocsTableRow, EntityListDocsTable } from './Tables';
|
||||
|
||||
export const DefaultTechDocsHome = ({
|
||||
initialFilter = 'all',
|
||||
columns,
|
||||
actions,
|
||||
}: {
|
||||
/**
|
||||
* Props for {@link DefaultTechDocsHome}
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type DefaultTechDocsHomeProps = {
|
||||
initialFilter?: UserListFilterKind;
|
||||
columns?: TableColumn<DocsTableRow>[];
|
||||
actions?: TableProps<DocsTableRow>['actions'];
|
||||
}) => {
|
||||
};
|
||||
|
||||
export const DefaultTechDocsHome = (props: DefaultTechDocsHomeProps) => {
|
||||
const { initialFilter = 'all', columns, actions } = props;
|
||||
return (
|
||||
<TechDocsPageWrapper>
|
||||
<Content>
|
||||
|
||||
@@ -26,16 +26,22 @@ import {
|
||||
import { Card, CardActions, CardContent, CardMedia } from '@material-ui/core';
|
||||
import React from 'react';
|
||||
|
||||
/**
|
||||
* Props for {@link DocsCardGrid}
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type DocsCardGridProps = {
|
||||
entities: Entity[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Component which accepts a list of entities and renders a item card for each entity
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const DocsCardGrid = ({
|
||||
entities,
|
||||
}: {
|
||||
entities: Entity[] | undefined;
|
||||
}) => {
|
||||
export const DocsCardGrid = (props: DocsCardGridProps) => {
|
||||
const { entities } = props;
|
||||
const getRouteToReaderPageFor = useRouteRef(rootDocsRouteRef);
|
||||
const config = useApi(configApiRef);
|
||||
if (!entities) return null;
|
||||
|
||||
@@ -138,11 +138,17 @@ const CustomPanel = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const TechDocsCustomHome = ({
|
||||
tabsConfig,
|
||||
}: {
|
||||
/**
|
||||
* Props for {@link TechDocsCustomHome}
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type TechDocsCustomHomeProps = {
|
||||
tabsConfig: TabsConfig;
|
||||
}) => {
|
||||
};
|
||||
|
||||
export const TechDocsCustomHome = (props: TechDocsCustomHomeProps) => {
|
||||
const { tabsConfig } = props;
|
||||
const [selectedTab, setSelectedTab] = useState<number>(0);
|
||||
const catalogApi: CatalogApi = useApi(catalogApiRef);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ export type {
|
||||
PanelConfig,
|
||||
TabConfig,
|
||||
TabsConfig,
|
||||
TechDocsCustomHomeProps,
|
||||
} from './TechDocsCustomHome';
|
||||
export * from './TechDocsPageWrapper';
|
||||
export * from './TechDocsPicker';
|
||||
|
||||
@@ -45,12 +45,10 @@ export type TechDocsReaderPageHeaderProps = PropsWithChildren<{
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const TechDocsReaderPageHeader = ({
|
||||
entityRef,
|
||||
entityMetadata,
|
||||
techDocsMetadata,
|
||||
children,
|
||||
}: TechDocsReaderPageHeaderProps) => {
|
||||
export const TechDocsReaderPageHeader = (
|
||||
props: TechDocsReaderPageHeaderProps,
|
||||
) => {
|
||||
const { entityRef, entityMetadata, techDocsMetadata, children } = props;
|
||||
const { name } = entityRef;
|
||||
|
||||
const { site_name: siteName, site_description: siteDescription } =
|
||||
|
||||
Reference in New Issue
Block a user