import * as React from 'react'; import tw from 'twin.macro'; import { ServerContext } from '@/state/server'; import styled from 'styled-components'; import Input from '@/components/elements/Input'; export const FileActionCheckbox = styled(Input)` && { ${tw`border-neutral-500 bg-transparent`}; &:not(:checked) { ${tw`hover:border-neutral-300`}; } } `; export default ({ name }: { name: string }) => { const isChecked = ServerContext.useStoreState(state => state.files.selectedFiles.indexOf(name) >= 0); const appendSelectedFile = ServerContext.useStoreActions(actions => actions.files.appendSelectedFile); const removeSelectedFile = ServerContext.useStoreActions(actions => actions.files.removeSelectedFile); return ( ); };