feat : update

This commit is contained in:
2026-09-07 22:20:25 +07:00 Unverified
parent bdf29c930e
commit 826cb23a70
12 changed files with 4095 additions and 48 deletions
+5 -5
View File
@@ -29,11 +29,11 @@ type ArtifactExportSection = (typeof sectionOptions)[number][0];
export function ArtifactImageExport({
children,
fileName,
targetConditionCount,
targetConditionLabels,
}: {
children: ReactNode;
fileName: string;
targetConditionCount: number;
targetConditionLabels: readonly string[];
}) {
const [sections, setSections] = useState<Set<ArtifactExportSection>>(
() => new Set(sectionOptions.map(([value]) => value)),
@@ -99,7 +99,7 @@ export function ArtifactImageExport({
</Field>
))}
</FieldGroup>
{sections.has("target-stats") && targetConditionCount > 1 ? (
{sections.has("target-stats") && targetConditionLabels.length > 1 ? (
<div className="flex flex-col gap-2">
<p className="text-sm font-medium">Target Stats condition</p>
<ToggleGroup
@@ -109,13 +109,13 @@ export function ArtifactImageExport({
if (values[0]) setTargetCondition(values[0]);
}}
>
{Array.from({ length: targetConditionCount }, (_, index) => (
{targetConditionLabels.map((label, index) => (
<ToggleGroupItem
key={index}
value={String(index)}
className="aria-pressed:bg-primary aria-pressed:text-primary-foreground"
>
Condition {index + 1}
{label}
</ToggleGroupItem>
))}
</ToggleGroup>