Commit 135dd26d authored by Merekeyev Dias's avatar Merekeyev Dias

added cool tag in status column

parent 036c47ef
import React from 'react'; import React from 'react';
import { useNavigate } from 'react-router'; import { useNavigate } from 'react-router';
import { MaterialSymbol } from 'react-material-symbols'; import { MaterialSymbol } from 'react-material-symbols';
import { Button, Pagination, Space, Spin, Table } from 'antd'; import { Button, Pagination, Space, Spin, Table, Tag } from 'antd';
import type { TableProps } from 'antd'; import type { TableProps } from 'antd';
import './Homepage.css'; import './Homepage.css';
import { useGetOrganizationsQuery } from '../../features/api/apiSlice'; import { useGetOrganizationsQuery } from '../../features/api/apiSlice';
...@@ -46,9 +46,12 @@ const columns: TableProps<DataType>['columns'] = [ ...@@ -46,9 +46,12 @@ const columns: TableProps<DataType>['columns'] = [
dataIndex: "status", dataIndex: "status",
key: "status", key: "status",
render: (_, record) => { render: (_, record) => {
let color = record.status == '0' ? 'red' : record.status == '1' ? 'processing' : 'green';
return ( return (
<p> <p>
{record.status == '0' ? 'удален' : record.status == '1' ? 'заблокирован' : 'активен'} <Tag color={color} style={{fontSize: '14px'}}>
{record.status == '0' ? 'удален' : record.status == '1' ? 'заблокирован' : 'активен'}
</Tag>
</p> </p>
) )
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment