From d5fa59f4779990d6c68f278515fd40a5893b8a85 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Tue, 3 Nov 2020 21:51:03 +0800 Subject: [PATCH] Feature: add connections filter --- src/containers/Connections/Devices/index.tsx | 35 +++++++++++++++++++ src/containers/Connections/Devices/style.scss | 21 +++++++++++ src/containers/Connections/index.tsx | 32 ++++++++++++++--- src/containers/Connections/style.scss | 4 +-- src/containers/Logs/style.scss | 4 ++- src/styles/variables.scss | 1 + 6 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 src/containers/Connections/Devices/index.tsx create mode 100644 src/containers/Connections/Devices/style.scss diff --git a/src/containers/Connections/Devices/index.tsx b/src/containers/Connections/Devices/index.tsx new file mode 100644 index 0000000..d228676 --- /dev/null +++ b/src/containers/Connections/Devices/index.tsx @@ -0,0 +1,35 @@ +import React from 'react' +import classnames from 'classnames' +import { BaseComponentProps } from '@models' +import './style.scss' + +interface DevicesProps extends BaseComponentProps { + devices: Array<{ label: string, number: number }> + selected: string + onChange?: (label: string) => void +} + +export function Devices (props: DevicesProps) { + const { className, style } = props + const classname = classnames('connections-devices', className) + function handleSelected (label: string) { + props.onChange?.(label) + } + + return ( +