feat(studio): add reset all overrides action to organize imports dialog
This commit is contained in:
1 parent
e47bee16bb
commit
0f1da6c178
3 files changed
+22
-2
No files matched your search
@@ -277,6 +277,11 @@ export function OrganizeImportsDialog({
|
||||
});
|
||||
};
|
||||
|
||||
const resetAllOverrides = () => {
|
||||
setOverrides({});
|
||||
setApproved(Object.fromEntries(groups.map((g) => [g.name, true])));
|
||||
};
|
||||
|
||||
const filteredGroups = useMemo(() => {
|
||||
const q = groupSearchQuery.trim().toLowerCase();
|
||||
if (!q) return groups;
|
||||
@@ -672,6 +677,19 @@ export function OrganizeImportsDialog({
|
||||
>
|
||||
{t("applyBatch")}
|
||||
</Button>
|
||||
|
||||
{Object.keys(overrides).length > 0 && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 px-2 text-[10px] text-muted-foreground hover:text-foreground"
|
||||
onClick={resetAllOverrides}
|
||||
>
|
||||
<RefreshCw className="mr-1 h-3 w-3" />
|
||||
{t("resetAll")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user