chore: lint fix

This commit is contained in:
Alejandro Gómez
2025-12-22 13:25:38 +01:00
parent ea3d0e1119
commit 32c895e150
3 changed files with 17 additions and 15 deletions

View File

@@ -84,11 +84,11 @@ export default function KindRenderer({ kind }: { kind: number }) {
: "Stored by relays"}
</div>
{isParameterizedReplaceableKind(kind) && (
<>
<div className="text-muted-foreground">Identifier</div>
<code className="font-mono text-xs">d-tag</code>
</>
)}
<>
<div className="text-muted-foreground">Identifier</div>
<code className="font-mono text-xs">d-tag</code>
</>
)}
{kindInfo.nip && (
<>
<div className="text-muted-foreground">Defined in</div>

View File

@@ -18,10 +18,7 @@ import { useMemo } from "react";
* const stableFilters = useStableValue(filters);
* ```
*/
export function useStableValue<T>(
value: T,
serialize?: (v: T) => string
): T {
export function useStableValue<T>(value: T, serialize?: (v: T) => string): T {
const serialized = serialize?.(value) ?? JSON.stringify(value);
// eslint-disable-next-line react-hooks/exhaustive-deps
return useMemo(() => value, [serialized]);

View File

@@ -45,7 +45,10 @@ export const PARAMETERIZED_REPLACEABLE_END = 40000; // exclusive: parameterized
* for consistency with NIP-01 terminology
*/
export function isParameterizedReplaceableKind(kind: number): boolean {
return kind >= PARAMETERIZED_REPLACEABLE_START && kind < PARAMETERIZED_REPLACEABLE_END;
return (
kind >= PARAMETERIZED_REPLACEABLE_START &&
kind < PARAMETERIZED_REPLACEABLE_END
);
}
/**
@@ -64,9 +67,11 @@ export function isAddressableKind(kind: number): boolean {
/**
* Get the category of a kind for display purposes
*/
export function getKindCategory(kind: number): 'regular' | 'replaceable' | 'ephemeral' | 'parameterized_replaceable' {
if (_isReplaceableKind(kind)) return 'replaceable';
if (_isEphemeralKind(kind)) return 'ephemeral';
if (isParameterizedReplaceableKind(kind)) return 'parameterized_replaceable';
return 'regular';
export function getKindCategory(
kind: number,
): "regular" | "replaceable" | "ephemeral" | "parameterized_replaceable" {
if (_isReplaceableKind(kind)) return "replaceable";
if (_isEphemeralKind(kind)) return "ephemeral";
if (isParameterizedReplaceableKind(kind)) return "parameterized_replaceable";
return "regular";
}