mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-09 23:16:50 +02:00
chore: lint fix
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user