diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx
index 3c0fe196d9..0c5f9f6537 100644
--- a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx
+++ b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx
@@ -1,5 +1,10 @@
import { Button } from '@penumbra-zone/ui/components/ui/button';
-import { Dialog, DialogContent, DialogHeader } from '@penumbra-zone/ui/components/ui/dialog';
+import {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogHeader,
+} from '@penumbra-zone/ui/components/ui/dialog';
import { IdentityKeyComponent } from '@penumbra-zone/ui/components/ui/identity-key-component';
import { InputBlock } from '../../../../shared/input-block';
import { Validator } from '@penumbra-zone/protobuf/penumbra/core/component/stake/v1/stake_pb';
@@ -9,10 +14,22 @@ import { getIdentityKey } from '@penumbra-zone/getters/validator';
import { getFormattedAmtFromValueView } from '@penumbra-zone/types/value-view';
import { BalanceValueView } from '@penumbra-zone/ui/components/ui/balance-value-view';
import { NumberInput } from '../../../../shared/number-input';
+import { CircleAlert } from 'lucide-react';
+import { useStoreShallow } from '../../../../../utils/use-store-shallow.ts';
+import { AllSlices } from '../../../../../state';
+import { bech32mIdentityKey } from '@penumbra-zone/bech32m/penumbravalid';
const getCapitalizedAction = (action: 'delegate' | 'undelegate') =>
action.replace(/^./, firstCharacter => firstCharacter.toLocaleUpperCase());
+// If validator has > 5 voting power, show warning to user
+const votingPowerSelector =
+ (validator: Validator, action?: 'delegate' | 'undelegate') => (state: AllSlices) => {
+ const votingPower =
+ state.staking.votingPowerByValidatorInfo[bech32mIdentityKey(getIdentityKey(validator))] ?? 0;
+ return action === 'delegate' && votingPower > 5;
+ };
+
/**
* Renders a dialog with a form for delegating to, or undelegating from, a
* validator.
@@ -51,6 +68,8 @@ export const FormDialog = ({
onClose: () => void;
onSubmit: () => void;
}) => {
+ const showDelegationWarning = useStoreShallow(votingPowerSelector(validator, action));
+
const handleOpenChange = (open: boolean) => {
if (!open) {
onClose();
@@ -87,8 +106,8 @@ export const FormDialog = ({
{/** @todo: Refactor this block to use `InputToken` (with a new
- boolean `showSelectModal` prop) once asset balances are
- refactored as `ValueView`s. */}
+ boolean `showSelectModal` prop) once asset balances are
+ refactored as `ValueView`s. */}