feat : update
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user