1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00
2020-12-20 01:21:24 -07:00

31 lines
760 B
TypeScript

import { AnimatePresence } from 'framer-motion';
import { If, HyperglassForm, Results } from '~/components';
import { useLGState } from '~/hooks';
import { all } from '~/util';
import { Frame } from './frame';
export const Layout: React.FC = () => {
const { isSubmitting, formData } = useLGState();
return (
<Frame>
<If
c={
isSubmitting.value &&
all(
formData.query_location.value,
formData.query_target.value,
formData.query_type.value,
formData.query_vrf.value,
)
}>
<Results />
</If>
<AnimatePresence>
<If c={!isSubmitting.value}>
<HyperglassForm />
</If>
</AnimatePresence>
</Frame>
);
};