Files
pezkuwi-apps/packages/page-sudo/src/index.tsx
T
pezkuwichain d21bfb1320 feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology:
- Polkadot → Pezkuwi
- Kusama → Dicle
- Westend → Zagros
- Rococo → PezkuwiChain
- Substrate → Bizinikiwi
- parachain → teyrchain

Custom logos with Kurdistan brand colors (#e6007a → #86e62a):
- bizinikiwi-hexagon.svg
- sora-bizinikiwi.svg
- hezscanner.svg
- heztreasury.svg
- pezkuwiscan.svg
- pezkuwistats.svg
- pezkuwiassembly.svg
- pezkuwiholic.svg
2026-01-07 13:05:27 +03:00

78 lines
1.8 KiB
TypeScript

// Copyright 2017-2025 @pezkuwi/app-js authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AppProps as Props } from '@pezkuwi/react-components/types';
import React, { useRef } from 'react';
import { Route, Routes } from 'react-router';
import { Icon, Tabs } from '@pezkuwi/react-components';
import { useSudo } from '@pezkuwi/react-hooks';
import SetKey from './SetKey.js';
import Sudo from './Sudo.js';
import { useTranslation } from './translate.js';
function SudoApp ({ basePath }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { allAccounts, hasSudoKey, sudoKey } = useSudo();
const itemsRef = useRef([
{
isRoot: true,
name: 'index',
text: t('Sudo access')
},
{
name: 'key',
text: t('Set sudo key')
}
]);
return (
<main>
<Tabs
basePath={basePath}
items={itemsRef.current}
/>
{hasSudoKey
? (
<Routes>
<Route path={basePath}>
<Route
element={
<SetKey
allAccounts={allAccounts}
isMine={hasSudoKey}
sudoKey={sudoKey}
/>
}
path='key'
/>
<Route
element={
<Sudo
isMine={hasSudoKey}
sudoKey={sudoKey}
/>
}
index
/>
</Route>
</Routes>
)
: (
<article className='error padded'>
<div>
<Icon icon='ban' />
{t('You do not have access to the current sudo key')}
</div>
</article>
)
}
</main>
);
}
export default React.memo(SudoApp);