import {List, Space} from "@douyinfe/semi-ui"
import {Link} from "react-router-dom";
import {formatDate} from "../../../utils/date.ts";
import {AppModel} from "../../../model";

export const AppList = (props: {
    list: AppModel[];
    onItemClick?: (app: AppModel) => void;
}) => {
    return (<div className="app-list-wrapper">
        {props.list.map(it => (
            <div key={it.id} className="list-link-item flex space-between" onClick={() =>{
                props.onItemClick?.(it)
            }}>
                <Space className="space">
                    <span>{it.id}</span>
                    <span>{it.title}</span>
                    <span>{formatDate(it.create_time)}</span>
                </Space>
                <span>进入</span>
            </div>
        ))}
    </div>)
}
