refactor: reviewer's comment
- use Preact's `FunctionalComponent` instead of React's `FC` to keep the app more lightweight - remove `@node_modules/` from imports
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { FC } from 'react';
|
||||
import { FunctionalComponent } from 'preact';
|
||||
|
||||
type Props = {
|
||||
application: WebApplication;
|
||||
protectionsDisabledUntil: string | null;
|
||||
};
|
||||
|
||||
const Protections: FC<Props> = ({
|
||||
application,
|
||||
protectionsDisabledUntil
|
||||
}) => {
|
||||
const Protections: FunctionalComponent<Props> = ({
|
||||
application,
|
||||
protectionsDisabledUntil
|
||||
}) => {
|
||||
const enableProtections = () => {
|
||||
application.clearProtectionSession();
|
||||
};
|
||||
@@ -41,6 +41,6 @@ const Protections: FC<Props> = ({
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Protections;
|
||||
|
||||
Reference in New Issue
Block a user