import React, { useEffect, useState } from 'react'; import CustomFieldForm from './CustomFieldForm'; import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; import { useModal } from 'App/components/Modal'; import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; import { List, Space, Typography, Button, Tooltip } from 'antd'; import { PencilIcon, PlusIcon, Tags } from 'lucide-react'; import {EditOutlined } from '@ant-design/icons'; import usePageTitle from '@/hooks/usePageTitle'; import { Empty } from '.store/antd-virtual-7db13b4af6/package'; const CustomFields = () => { usePageTitle('Metadata - OpenReplay Preferences'); const { customFieldStore: store, projectsStore } = useStore(); const currentSite = projectsStore.config.project; const { showModal, hideModal } = useModal(); const fields = store.list; const [loading, setLoading] = useState(false); useEffect(() => { setLoading(true); store.fetchList(currentSite?.id).finally(() => { setLoading(false); }); }, [currentSite]); const handleInit = (field?: any) => { store.init(field); showModal(, { title: field ? 'Edit Metadata' : 'Add Metadata', right: true }); }; const remaining = 10 - fields.length; return (
Attach key-value pairs to session replays for enhanced filtering, searching, and identifying relevant user sessions. Learn more 0 ? '' : 'You\'ve reached the limit of 10 metadata.'} > {/*{remaining === 0 && }*/} {remaining === 0 ? 'You have reached the limit of 10 metadata.' : `${remaining}/10 Remaining for this project`} } /> }} loading={loading} dataSource={fields} renderItem={(field: any) => ( handleInit(field)} className="cursor-pointer group hover:bg-active-blue !px-4" actions={[
); }; export default observer(CustomFields);