// modules/dashboard/components/WidgetSettings.tsx import React, { useState } from "react"; import { motion } from "framer-motion"; import type { ChartType, ChartWidget } from "../types"; interface WidgetSettingsProps { widget: ChartWidget; onUpdate: (widget: ChartWidget) => void; onRemove: () => void; onClose: () => void; } export const WidgetSettings: React.FC = ({ widget, onUpdate, onRemove, onClose, }) => { const [type, setType] = useState(widget.type); const [title, setTitle] = useState(widget.title); const handleSave = () => { onUpdate({ ...widget, type, title }); onClose(); }; return ( e.stopPropagation()} >

Настройки графика

{(["line", "bar", "area", "pie"] as ChartType[]).map((t) => ( ))}
setTitle(e.target.value)} className="w-full px-2 py-1 text-[11px] bg-tertiary border border-primary rounded text-primary focus:outline-none focus:border-accent-primary" />
); };