React 18 and Vite (#4510)
This commit is contained in:
parent
1bb1b13f6d
commit
21613fa602
244 changed files with 4547 additions and 8933 deletions
|
@ -1,7 +1,6 @@
|
|||
import styled from 'styled-components/macro';
|
||||
import styled from 'styled-components';
|
||||
import tw from 'twin.macro';
|
||||
import Checkbox from '@/components/elements/Checkbox';
|
||||
import React from 'react';
|
||||
import { useStoreState } from 'easy-peasy';
|
||||
import Label from '@/components/elements/Label';
|
||||
|
||||
|
@ -36,8 +35,8 @@ interface Props {
|
|||
}
|
||||
|
||||
const PermissionRow = ({ permission, disabled }: Props) => {
|
||||
const [key, pkey] = permission.split('.', 2);
|
||||
const permissions = useStoreState((state) => state.permissions.data);
|
||||
const [key = '', pkey = ''] = permission.split('.', 2);
|
||||
const permissions = useStoreState(state => state.permissions.data);
|
||||
|
||||
return (
|
||||
<Container htmlFor={`permission_${permission}`} className={disabled ? 'disabled' : undefined}>
|
||||
|
@ -54,8 +53,8 @@ const PermissionRow = ({ permission, disabled }: Props) => {
|
|||
<Label as={'p'} css={tw`font-medium`}>
|
||||
{pkey}
|
||||
</Label>
|
||||
{permissions[key].keys[pkey].length > 0 && (
|
||||
<p css={tw`text-xs text-neutral-400 mt-1`}>{permissions[key].keys[pkey]}</p>
|
||||
{(permissions[key]?.keys?.[pkey]?.length ?? 0) > 0 && (
|
||||
<p css={tw`text-xs text-neutral-400 mt-1`}>{permissions[key]?.keys?.[pkey] ?? ''}</p>
|
||||
)}
|
||||
</div>
|
||||
</Container>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue