import { Tag, Space, Popconfirm, Switch } from 'antd'; import { open } from '@tauri-apps/api/shell'; export const awesomeColumns = () => [ { title: 'Title', dataIndex: 'title', fixed: 'left', key: 'title', width: 160, }, { title: 'URL', dataIndex: 'url', key: 'url', width: 200, render: (v: string) => open(v)}>{v}, }, // { // title: 'Icon', // dataIndex: 'icon', // key: 'icon', // width: 120, // }, { title: 'Enable', dataIndex: 'enable', key: 'enable', width: 80, render: (v: boolean = true, row: Record, action: Record) => ( action.setRecord({ ...row, enable: v }, 'enable')} /> ), }, { title: 'Category', dataIndex: 'category', key: 'category', width: 120, render: (v: string) => {v}, }, { title: 'Tags', dataIndex: 'tags', key: 'tags', width: 150, render: (v: string[]) => ( {v?.map((i) => ( {i} ))} ), }, { title: 'Action', fixed: 'right', width: 150, render: (_: any, row: any, actions: any) => { return ( actions.setRecord(row, 'edit')}>Edit actions.setRecord(row, 'delete')} okText="Yes" cancelText="No" > Delete ); }, }, ];