import React, { useState } from 'react';
import { PieChart, Pie, Cell, ResponsiveContainer, Legend, Tooltip } from 'recharts';
import { ArrowRight, ArrowLeft, Home, RefreshCw, FileText } from 'lucide-react';
const TexasHeirshipCalculator = () => {
const [step, setStep] = useState(0);
const [answers, setAnswers] = useState({
maritalStatus: null,
hasChildren: null,
childrenFromMarriage: null,
parentStatus: null, // 'both', 'one', 'none'
hasSiblings: null,
diedAfter1993: true
});
const COLORS = {
spouse: '#fb923c',
children: '#f97316',
parent: '#facc15',
siblings: '#a3e635',
lifeEstate: '#f9a8d4',
all: '#06b6d4'
};
const questions = [
{
id: 'maritalStatus',
question: 'What was the decedent\'s marital status at death?',
options: [
{ value: 'married', label: 'Married' },
{ value: 'unmarried', label: 'Not Married' }
]
},
{
id: 'hasChildren',
question: 'Did the decedent have any children or descendants?',
options: [
{ value: true, label: 'Yes' },
{ value: false, label: 'No' }
],
condition: () => true
},
{
id: 'childrenFromMarriage',
question: 'Are all surviving children and descendants also children or descendants of the surviving spouse?',
options: [
{ value: true, label: 'Yes, all children are from this marriage' },
{ value: false, label: 'No, there are children from outside the marriage' }
],
condition: () => answers.maritalStatus === 'married' && answers.hasChildren === true
},
{
id: 'parentStatus',
question: 'Which of the decedent\'s parents survived them?',
options: [
{ value: 'both', label: 'Both parents survived' },
{ value: 'one', label: 'Only one parent survived' },
{ value: 'none', label: 'Neither parent survived' }
],
condition: () => answers.hasChildren === false
},
{
id: 'hasSiblings',
question: 'Did any siblings or descendants of siblings survive the decedent?',
options: [
{ value: true, label: 'Yes' },
{ value: false, label: 'No' }
],
condition: () => answers.hasChildren === false && (answers.parentStatus === 'one' || answers.parentStatus === 'none')
}
];
const calculateDistribution = () => {
const { maritalStatus, hasChildren, childrenFromMarriage, parentStatus, hasSiblings } = answers;
// MARRIED WITH CHILDREN
if (maritalStatus === 'married' && hasChildren) {
return {
separatePersonal: [
{ name: 'Surviving Spouse', value: 33.33, color: COLORS.spouse, cite: 'EC § 201.002(b)' },
{ name: 'Children', value: 66.67, color: COLORS.children, cite: 'EC § 201.002(b)' }
],
separateReal: [
{ name: 'Surviving Spouse (1/3 Life Estate)', value: 33.33, color: COLORS.lifeEstate, cite: 'EC § 201.002(b)', note: 'Life estate only - full ownership passes to children upon spouse\'s death' },
{ name: 'Children (Subject to Life Estate)', value: 66.67, color: COLORS.children, cite: 'EC § 201.002(b)' }
],
community: childrenFromMarriage ? [
{ name: 'Surviving Spouse', value: 100, color: COLORS.all, cite: 'EC § 201.003(b)(2)' }
] : [
{ name: 'Children', value: 100, color: COLORS.children, cite: 'EC § 201.003(c)', note: 'Surviving spouse retains their own 1/2 share of community property' }
],
scenario: 'married-with-children'
};
}
// MARRIED WITHOUT CHILDREN
if (maritalStatus === 'married' && !hasChildren) {
const separatePersonal = [
{ name: 'Surviving Spouse', value: 100, color: COLORS.all, cite: 'EC § 201.002(c)(1)' }
];
let separateReal = [];
if (parentStatus === 'both') {
// Both parents survive
separateReal = [
{ name: 'Surviving Spouse', value: 50, color: COLORS.spouse, cite: 'EC §§ 201.001(c), 201.002(c)(2) & (3)' },
{ name: 'Mother', value: 25, color: COLORS.parent, cite: 'EC §§ 201.001(c), 201.002(c)(2) & (3)' },
{ name: 'Father', value: 25, color: COLORS.parent, cite: 'EC §§ 201.001(c), 201.002(c)(2) & (3)' }
];
} else if (parentStatus === 'one' && hasSiblings === true) {
// One parent + siblings
separateReal = [
{ name: 'Surviving Spouse', value: 50, color: COLORS.spouse, cite: 'EC §§ 201.001(d)(1), 201.002(c)(2) & (3)' },
{ name: 'Surviving Parent', value: 25, color: COLORS.parent, cite: 'EC §§ 201.001(d)(1), 201.002(c)(2) & (3)' },
{ name: 'Siblings/Descendants', value: 25, color: COLORS.siblings, cite: 'EC §§ 201.001(d)(1), 201.002(c)(2) & (3)' }
];
} else if (parentStatus === 'one' && hasSiblings === false) {
// One parent, NO siblings
separateReal = [
{ name: 'Surviving Spouse', value: 50, color: COLORS.spouse, cite: 'EC §§ 201.001(d)(2), 201.002(c)(2) & (3)' },
{ name: 'Surviving Parent', value: 50, color: COLORS.parent, cite: 'EC §§ 201.001(d)(2), 201.002(c)(2) & (3)' }
];
} else if (parentStatus === 'none' && hasSiblings === true) {
// No parents + siblings
separateReal = [
{ name: 'Surviving Spouse', value: 50, color: COLORS.spouse, cite: 'EC §§ 201.001(e), 201.002(c)(2) & (3)' },
{ name: 'Siblings/Descendants', value: 50, color: COLORS.siblings, cite: 'EC §§ 201.001(e), 201.002(c)(2) & (3)' }
];
} else {
// No parents, no siblings
separateReal = [
{ name: 'Surviving Spouse', value: 100, color: COLORS.all, cite: 'EC § 201.002(d)' }
];
}
const community = [
{ name: 'Surviving Spouse', value: 100, color: COLORS.all, cite: 'EC § 201.003(b)(1)' }
];
return { separatePersonal, separateReal, community, scenario: 'married-no-children' };
}
// UNMARRIED WITH CHILDREN
if (maritalStatus === 'unmarried' && hasChildren) {
const allProperty = [
{ name: 'Children', value: 100, color: COLORS.children, cite: 'EC § 201.001(b)', note: 'Children take equally per capita with representation' }
];
return { allProperty, scenario: 'unmarried-with-children' };
}
// UNMARRIED WITHOUT CHILDREN
if (maritalStatus === 'unmarried' && !hasChildren) {
let allProperty = [];
if (parentStatus === 'both') {
// Both parents survive
allProperty = [
{ name: 'Mother', value: 50, color: COLORS.parent, cite: 'EC § 201.001(c)' },
{ name: 'Father', value: 50, color: COLORS.parent, cite: 'EC § 201.001(c)' }
];
} else if (parentStatus === 'one' && hasSiblings === true) {
// One parent + siblings
allProperty = [
{ name: 'Surviving Parent', value: 50, color: COLORS.parent, cite: 'EC § 201.001(d)(1)' },
{ name: 'Siblings/Descendants', value: 50, color: COLORS.siblings, cite: 'EC § 201.001(d)(1)' }
];
} else if (parentStatus === 'one' && hasSiblings === false) {
// One parent, NO siblings
allProperty = [
{ name: 'Surviving Parent', value: 100, color: COLORS.all, cite: 'EC § 201.001(d)(2)' }
];
} else if (parentStatus === 'none' && hasSiblings === true) {
// No parents + siblings
allProperty = [
{ name: 'Siblings/Descendants', value: 100, color: COLORS.siblings, cite: 'EC § 201.001(e)' }
];
} else if (parentStatus === 'none' && hasSiblings === false) {
// No parents, no siblings - goes to grandparents/kindred
allProperty = [
{ name: 'Paternal Kindred', value: 50, color: COLORS.parent, cite: 'EC § 201.001(f)-(g)', note: 'To paternal grandparents or their descendants' },
{ name: 'Maternal Kindred', value: 50, color: COLORS.siblings, cite: 'EC § 201.001(f) & (h)', note: 'To maternal grandparents or their descendants' }
];
}
return { allProperty, scenario: 'unmarried-no-children' };
}
return null;
};
const currentQuestion = questions[step];
const filteredQuestions = questions.filter(q => !q.condition || q.condition());
const isLastQuestion = step >= filteredQuestions.length - 1;
const showResults = step >= filteredQuestions.length;
const handleAnswer = (value) => {
setAnswers({ ...answers, [currentQuestion.id]: value });
if (isLastQuestion) {
setStep(filteredQuestions.length);
} else {
const nextQuestion = questions.findIndex((q, idx) =>
idx > step && (!q.condition || q.condition())
);
setStep(nextQuestion);
}
};
const handleBack = () => {
if (step === 0) return;
if (step >= filteredQuestions.length) {
setStep(filteredQuestions.length - 1);
return;
}
const prevQuestion = [...questions].reverse().findIndex((q, idx) => {
const actualIdx = questions.length - 1 - idx;
return actualIdx < step && (!q.condition || q.condition());
});
const prevIdx = questions.length - 1 - prevQuestion;
setStep(prevIdx);
};
const reset = () => {
setStep(0);
setAnswers({
maritalStatus: null,
hasChildren: null,
childrenFromMarriage: null,
parentStatus: null,
hasSiblings: null,
diedAfter1993: true
});
};
const renderChart = (data, title, note) => (
{title}
`${name}: ${value.toFixed(1)}%`}
outerRadius={80}
fill="#8884d8"
dataKey="value"
>
{data.map((entry, index) => (
|
))}
`${value.toFixed(2)}%`} />
{data.map((entry, idx) => (
{entry.name}: {entry.value.toFixed(2)}%
{entry.cite}
{entry.note && (
{entry.note}
)}
))}
{note && (
Note: {note}
)}
);
const renderResults = () => {
const distribution = calculateDistribution();
if (!distribution) return null;
return (
Distribution Results
Based on Texas intestacy laws for decedents dying after September 1, 1993
{distribution.separatePersonal && renderChart(
distribution.separatePersonal,
"Separate Personal Property",
"All property that is not real property"
)}
{distribution.separateReal && renderChart(
distribution.separateReal,
"Separate Real Property",
distribution.scenario === 'married-with-children' ?
"Surviving spouse receives a life estate in 1/3. Upon spouse's death, all property passes to children." : null
)}
{distribution.community && renderChart(
distribution.community,
"Decedent's Share of Community Property",
answers.childrenFromMarriage === false ?
"Surviving spouse retains their own 1/2 share of community property" : null
)}
{distribution.allProperty && renderChart(
distribution.allProperty,
"All Property Distribution"
)}
Important Legal Information
This calculator provides general information about Texas intestacy laws. It is not legal advice.
Actual distributions may vary based on specific circumstances, property characterization, and other legal factors.
For specific legal guidance regarding an estate, consult with a qualified Texas attorney.
Additional Provisions:
• Per Capita with Representation: EC § 201.101 governs how descendants inherit when some heirs are deceased
• 120-Hour Survival Rule: EC §§ 121.052 & 121.053 require heirs to survive decedent by 120 hours
• Adoption: EC § 201.054 addresses inheritance rights of adopted children
• Half/Whole Blood: EC § 201.057 affects collateral kindred inheritance
• Advancements: EC §§ 201.151-152 govern lifetime gifts treated as advancements
• Persons Not in Being: EC § 201.056 addresses posthumous children and gestation
Calculate Another Estate
Compliments of Judge Guy Herman, Travis County Probate Court No. 1
Calculator developed by The Walters Firm PLLC
);
};
if (showResults) {
return (
{renderResults()}
);
}
return (
{/* Header */}
Texas Heirship Calculator
Determine intestate succession under Texas law
{/* Progress Bar */}
Question {Math.min(step + 1, filteredQuestions.length)} of {filteredQuestions.length}
{Math.round(((step + 1) / filteredQuestions.length) * 100)}% Complete
{/* Question Card */}
{currentQuestion?.question}
{currentQuestion?.options.map((option, idx) => (
handleAnswer(option.value)}
className="w-full text-left p-4 rounded-lg border-2 border-gray-200 hover:border-blue-500 hover:bg-blue-50 transition-all duration-200 group"
>
{option.label}
))}
{/* Navigation */}
{/* Footer */}
For decedents dying after September 1, 1993
Based on Texas Estates Code provisions
);
};