import { useSignal, type Signal } from "@preact/signals"; import { bplan, dplan, Plan, plandb } from "../common/plan.ts"; export interface PlanDBProps { date: Signal; plans: Signal; cplan: Signal; } export interface PlanDisplayProps { plan: Plan; add?: (plan: Plan) => any; modify?: (plan: Plan) => any; del?: (plan: Plan) => any; } export function PlanDisplay({ plan, add, modify, del }: PlanDisplayProps) { const cplan: Signal = useSignal({ ...dplan, ...plan }); return
{JSON.stringify(cplan.value)}
; } export default function PlanDB({ date, plans, cplan }: PlanDBProps) { return
所有
{Object.entries(plans.value).map(([k, v]) => )}
预设
{Object.entries(plandb).map(([k, v]) => )}
; }