CommandInfo & window edits
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -80,8 +80,8 @@ export async function openFullWindow({
|
||||
export async function openWindow({
|
||||
name,
|
||||
url,
|
||||
width = 820,
|
||||
height = platform() === 'windows' ? 730 : 700,
|
||||
width = 840,
|
||||
height = platform() === 'windows' ? 755 : 725,
|
||||
}: {
|
||||
name: string
|
||||
url: string
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Accordion, AccordionItem } from '@heroui/react'
|
||||
import { InfoIcon } from 'lucide-react'
|
||||
import { startTransition, useState } from 'react'
|
||||
|
||||
export default function CommandInfo({ content }: { content: string }) {
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
|
||||
return (
|
||||
<Accordion
|
||||
variant="light"
|
||||
fullWidth={true}
|
||||
onSelectionChange={() => {
|
||||
startTransition(() => {
|
||||
setIsOpen((prev) => !prev)
|
||||
})
|
||||
}}
|
||||
>
|
||||
<AccordionItem
|
||||
key="command-info"
|
||||
title={
|
||||
isOpen
|
||||
? 'Tap here to hide the info about this command'
|
||||
: 'Tap here to see more info about this command'
|
||||
}
|
||||
classNames={{
|
||||
base: '-mx-2 bg-primary-100 rounded-b-large px-8 whitespace-pre-wrap text-primary-900',
|
||||
trigger: 'pb-1.5 pt-1 !cursor-pointer',
|
||||
title: 'text-small !cursor-pointer text-primary-700 font-light',
|
||||
}}
|
||||
indicator={<InfoIcon className="text-primary-800 size-3.5" />}
|
||||
>
|
||||
{content}
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user