@blocklet/ui-react
Version:
Some useful front-end web components that can be used in Blocklets.
49 lines (48 loc) • 1.44 kB
TypeScript
/**
* Activity types enum for type safety
* @readonly
* @enum {string}
*/
declare const ACTIVITY_TYPES: {
readonly COMMENT: "comment";
readonly LIKE: "like";
readonly FOLLOW: "follow";
readonly TIPS: "tips";
readonly MENTION: "mention";
readonly ASSIGN: "assign";
};
type ActivityTypeValues = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES];
interface UserData {
did: string;
fullName: string;
}
interface ActivityTarget {
type: string;
name: string;
}
interface Activity {
type: ActivityTypeValues;
target: ActivityTarget;
}
interface ExtraParams {
linkColor?: string;
[key: string]: any;
}
interface ActivityTitleProps {
activity: Activity;
users: UserData[];
actors: string[];
extra?: ExtraParams;
mountPoint?: string;
}
/**
* A hook that returns a formatted activity title with linked usernames
* @param {Object} params - The parameters object
* @param {keyof typeof ACTIVITY_TYPES} params.type - The activity type
* @param {Object} params.target - The target object
* @param {Array<{did: string, fullName: string}>} params.users - Array of user objects
* @param {Object} params.extra - Extra parameters
* @returns {React.ReactNode} Formatted title with linked usernames
*/
export default function useActivityTitle({ activity, users, actors, extra, mountPoint }: ActivityTitleProps): import("react/jsx-runtime").JSX.Element | null;
export {};