ghost-portal/packages/page-gilt/src/index.tsx
2022-01-01 09:30:15 +02:00

44 lines
894 B
TypeScript

// Copyright 2017-2022 @polkadot/app-gilt authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React, { useRef } from 'react';
import { Route, Switch } from 'react-router';
import { Tabs } from '@polkadot/react-components';
import Overview from './Overview';
import { useTranslation } from './translate';
interface Props {
basePath: string;
className?: string;
}
function GiltApp ({ basePath, className }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const tabsRef = useRef([
{
isRoot: true,
name: 'overview',
text: t<string>('Overview')
}
]);
return (
<main className={className}>
<Tabs
basePath={basePath}
items={tabsRef.current}
/>
<Switch>
<Route>
<Overview />
</Route>
</Switch>
</main>
);
}
export default React.memo(GiltApp);