@@ -4,22 +4,19 @@ import {
44 getFrameV2Flattened ,
55 type ParsingReport ,
66} from "frames.js" ;
7- import {
8- AlertTriangleIcon ,
9- CheckCircle2Icon ,
10- XCircleIcon ,
11- AlertTriangle ,
12- } from "lucide-react" ;
7+ import { AlertTriangleIcon , CheckCircle2Icon , XCircleIcon } from "lucide-react" ;
138import { useMemo } from "react" ;
149import { ShortenedText } from "./shortened-text" ;
1510import type { DebuggerFrameStackItem } from "../hooks/useDebuggerFrameState" ;
1611import { cn } from "@/lib/utils" ;
1712import type { ProtocolConfiguration } from "./protocol-config-button" ;
1813import { Alert , AlertDescription , AlertTitle } from "@/components/ui/alert" ;
14+ import type { FarcasterSigner } from "@frames.js/render/identity/farcaster" ;
1915
2016type FrameDebuggerDiagnosticsProps = {
2117 stackItem : DebuggerFrameStackItem ;
2218 protocol : ProtocolConfiguration ;
19+ farcasterSigner : FarcasterSigner | null ;
2320} ;
2421
2522function isPropertyExperimental ( [ key , value ] : [ string , string ] ) {
@@ -30,6 +27,7 @@ function isPropertyExperimental([key, value]: [string, string]) {
3027export function FrameDebuggerDiagnostics ( {
3128 stackItem,
3229 protocol,
30+ farcasterSigner,
3331} : FrameDebuggerDiagnosticsProps ) {
3432 const properties = useMemo ( ( ) => {
3533 /** tuple of key and value */
@@ -121,6 +119,10 @@ export function FrameDebuggerDiagnostics({
121119 stackItem = { stackItem }
122120 protocol = { protocol }
123121 />
122+ < FarcasterV2DoesNotSupportImpersonatedSignersAlert
123+ protocol = { protocol }
124+ farcasterSigner = { farcasterSigner }
125+ />
124126 < Table >
125127 < TableBody >
126128 < TableRow >
@@ -237,7 +239,7 @@ function TryDifferentFarcasterSpecificationAlert({
237239 ) {
238240 return (
239241 < Alert className = "mb-4" variant = "destructive" >
240- < AlertTriangle className = "h-4 w-4" />
242+ < AlertTriangleIcon className = "h-4 w-4" />
241243 < AlertTitle > Warning!</ AlertTitle >
242244 < AlertDescription >
243245 This frame appears to be Farcaster v1 compatible only. Try parsing
@@ -257,7 +259,7 @@ function TryDifferentFarcasterSpecificationAlert({
257259 ) {
258260 return (
259261 < Alert className = "mb-4" variant = "destructive" >
260- < AlertTriangle className = "h-4 w-4" />
262+ < AlertTriangleIcon className = "h-4 w-4" />
261263 < AlertTitle > Warning!</ AlertTitle >
262264 < AlertDescription >
263265 This frame appears to be Farcaster v2 compatible only. Try parsing it
@@ -269,3 +271,31 @@ function TryDifferentFarcasterSpecificationAlert({
269271
270272 return null ;
271273}
274+
275+ type FarcasterV2DoesNotSupportImpersonatedSignersAlertProps = {
276+ farcasterSigner : FarcasterSigner | null ;
277+ protocol : ProtocolConfiguration ;
278+ } ;
279+
280+ function FarcasterV2DoesNotSupportImpersonatedSignersAlert ( {
281+ protocol,
282+ farcasterSigner : signer ,
283+ } : FarcasterV2DoesNotSupportImpersonatedSignersAlertProps ) {
284+ if ( protocol . protocol !== "farcaster_v2" ) {
285+ return null ;
286+ }
287+
288+ if ( signer ?. status !== "impersonating" ) {
289+ return ;
290+ }
291+
292+ return (
293+ < Alert className = "mb-4" variant = "destructive" >
294+ < AlertTriangleIcon className = "h-4 w-4" />
295+ < AlertTitle > Unsupported farcaster signer</ AlertTitle >
296+ < AlertDescription >
297+ Please use approved signer because impersonated signer is not supported.
298+ </ AlertDescription >
299+ </ Alert >
300+ ) ;
301+ }
0 commit comments