Feat: Translate the begin operator #3221 (#7811)

### What problem does this PR solve?

Feat: Translate the begin operator #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-05-23 14:18:27 +08:00
committed by GitHub
parent ab29b58316
commit e6cd799d8a
9 changed files with 148 additions and 70 deletions

View File

@ -0,0 +1,28 @@
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from '@/components/ui/collapsible';
import { ListCollapse } from 'lucide-react';
import { PropsWithChildren, ReactNode } from 'react';
type CollapseProps = {
title?: ReactNode;
rightContent?: ReactNode;
} & PropsWithChildren;
export function Collapse({ title, children, rightContent }: CollapseProps) {
return (
<Collapsible defaultOpen>
<CollapsibleTrigger className="w-full">
<section className="flex justify-between items-center pb-2">
<div className="flex items-center gap-1">
<ListCollapse className="size-4" /> {title}
</div>
<div>{rightContent}</div>
</section>
</CollapsibleTrigger>
<CollapsibleContent>{children}</CollapsibleContent>
</Collapsible>
);
}