24 lines
705 B
TypeScript
24 lines
705 B
TypeScript
/* eslint-disable react/forbid-component-props */
|
||
import { FormContext } from './context/form-context';
|
||
import * as apiIUS from '@/api/ius/query';
|
||
import Link from 'next/link';
|
||
import { useContext } from 'react';
|
||
import { Heading } from 'ui';
|
||
|
||
export function Header() {
|
||
const { createUrl } = useContext(FormContext);
|
||
|
||
return apiIUS.getConfig({ createUrl }).then(({ title }) => (
|
||
<div className="flex justify-between">
|
||
<Heading size={2}>{title}</Heading>
|
||
<Link
|
||
href={'/ius' + createUrl('/conditions')}
|
||
className="text-primary-600 text-sm font-medium hover:underline"
|
||
prefetch
|
||
>
|
||
Посмотреть условия
|
||
</Link>
|
||
</div>
|
||
));
|
||
}
|