move ai input under create button in card modal

This commit is contained in:
nick-delirium 2024-08-02 15:12:09 +02:00
parent 31d82f9d1d
commit 7de1672599
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 7 additions and 6 deletions

View file

@ -22,6 +22,7 @@ interface Props {
// cardType: string,
onBack?: () => void
onAdded?: () => void
extra?: React.ReactNode
}
function CreateCard(props: Props) {
@ -96,6 +97,7 @@ function CreateCard(props: Props) {
</Space>
</Button>
</div>
{props.extra}
{/*<CardBuilder siteId={siteId}/>*/}
<WidgetFormNew/>
<WidgetPreview className="" name={metric.name} isEditing={true}/>

View file

@ -39,10 +39,10 @@ const InputBox = observer(({ inModal }: { inModal?: boolean }) => {
};
return (
<>
<div className={'flex items-center mb-2 gap-2'}>
<Icon name={'sparkles'} size={16} />
<div className={'font-semibold'}>What would you like to visualize?</div>
</div>
{!inModal ? <div className={"flex items-center mb-2 gap-2"}>
<Icon name={"sparkles"} size={16} />
<div className={"font-semibold"}>What would you like to visualize?</div>
</div> : null}
<div style={gradientBox}>
<Input
wrapperClassName={'w-full pr-2'}
@ -100,11 +100,10 @@ const QueryModal = observer(() => {
centered={true}
>
<div className={'flex flex-col gap-2'}>
<InputBox inModal />
{aiFiltersStore.isLoading ? (
<Loader />
) : (
<CreateCard onAdded={onClose} />
<CreateCard extra={<InputBox inModal />} onAdded={onClose} />
)}
</div>
</Modal>