import { getActivityQueryOptions } from "@/shared/plugin-activity/query-options"; import usePluginSelectedStore from "@/stores/pluginSelectedStore"; import { useQuery } from "@tanstack/react-query"; import { Card, CardBody, CardHeader, Spinner, Icon } from "@wordpress/components"; import { __ } from "@wordpress/i18n"; import { seen, trash, plugins, closeSmall, download } from "@wordpress/icons"; const Activity = () => { const { plugin } = usePluginSelectedStore() const { data, isPending } = useQuery(getActivityQueryOptions(plugin?.slug ?? '')) if (isPending) { return (
) } return ( {__('Activity', 'ploogins-ai-assistant')}
{data?.map((activity) => (
{activity.activity_type === 'view' && } {activity.activity_type === 'install' && } {activity.activity_type === 'delete' && } {activity.activity_type === 'activate' && } {activity.activity_type === 'deactivate' && }

{activity.activity_text}

{ activity.activity_user_avatar && ( {activity.activity_user_display_name} ) } {activity.activity_user_display_name}
))}
) } export default Activity;