fix(admin): hopefully fix an exception that is being thrown in develop. Closes #3373

This commit is contained in:
Gabe Kangas
2023-10-25 20:01:04 -07:00
parent 9ab6fd9283
commit 57ff30c894

View File

@@ -37,18 +37,23 @@ export const ClientTable: FC<ClientTableProps> = ({ data }) => {
sorter: (a: any, b: any) => b.user.displayName.localeCompare(a.user.displayName), sorter: (a: any, b: any) => b.user.displayName.localeCompare(a.user.displayName),
filterIcon: <SearchOutlined />, filterIcon: <SearchOutlined />,
// eslint-disable-next-line react/no-unstable-nested-components // eslint-disable-next-line react/no-unstable-nested-components
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm }: FilterDropdownProps) => ( filterDropdown: ({ setSelectedKeys, selectedKeys, confirm }: FilterDropdownProps) => {
<div style={{ padding: 8 }}> if (selectedKeys.length === 0) {
<Input return null;
placeholder="Search display names..." }
value={selectedKeys[0].toString()} // Convert selectedKeys[0] to string return (
onChange={e => { <div style={{ padding: 8 }}>
setSelectedKeys(e.target.value ? [e.target.value] : []); <Input
confirm({ closeDropdown: false }); placeholder="Search display names..."
}} value={selectedKeys[0].toString()} // Convert selectedKeys[0] to string
/> onChange={e => {
</div> setSelectedKeys(e.target.value ? [e.target.value] : []);
), confirm({ closeDropdown: false });
}}
/>
</div>
);
},
onFilter: (value: string, record: Client) => record.user.displayName.includes(value), onFilter: (value: string, record: Client) => record.user.displayName.includes(value),
sortDirections: ['descend', 'ascend'] as SortOrder[], sortDirections: ['descend', 'ascend'] as SortOrder[],
}, },